Page 1 of 1

Mac OS X Installation

Posted: Wed Jan 04, 2006 7:53 pm
by ybart
I had installed Unrealircd for a Mac OS X box. I had to modify manually Makefile and add -lindl in LDFLAGS.

Then I copied example.conf and renamed it unrealircd.conf as required.

When I tried to launch unreal (unreal start). I got that

Code: Select all

* Loading IRCd configuration ..
[error] Couldn't open "unrealircd.conf": Permission denied
[error] Could not load config file unrealircd.conf
[error] IRCd configuration failed to load
Possible error encountered (IRCd seemily not started)
So, I tried using sudo, and this worked (despite errors in my yet unchanged configuration file). I thought this permission deny was not normal. So I tried to investigate.

I did 'ls -l unrealircd.conf' and got ---x-wx--T.
I had effictively no read right on this file. So I chmod 600 it. But nothing changed, since ircd restored ---x-wx--T before loading the config file.

I had no more ideas, and moreover, I don't understand that T added by ircd.

So, how to cleanly get rid of this permission problem ? Do I really need to run it as root ?

Thanks.

Posted: Wed Jan 04, 2006 7:55 pm
by Syzop
Most likely you answered the permissions question in ./Config a bit incorrect.

Do a:

Code: Select all

make clean; ./Config && make
Among other ./Config questions you will get this one:

Code: Select all

What should the default permissions for your configuration files be? (Set this to 0 to disable)
It is strongly recommended that you use 0600 to prevent unwanted reading of the file
[0600] ->
Answer that with: 0600

(most likely you will see some other incorrect value in brackets during your ./Config ;p)

Posted: Wed Jan 04, 2006 8:01 pm
by ybart
Thanks, I will try that !

Posted: Wed Jan 04, 2006 8:24 pm
by ybart
That was not that. Might it be an endian problem since I am on PowerPC platform ?

Code: Select all

./configure --with-showlistmodes --enable-ssl --enable-ziplinks --enable-inet6 --enable-prefixaq --with-listen=5 --with-dpath=/Users/yvanbarthelemy/Unreal3.2 --with-spath=/Users/yvanbarthelemy/Unreal3.2/src/ircd --with-nick-history=2000 --with-sendq=3000000 --with-bufferpool=18 --with-hostname=kami-no-kaze.fleming.u-psud.fr --with-permissions=0600 --with-fd-setsize=1024 --enable-dynamic-linking
I investigated this, but seems that was useless :

Code: Select all

> touch aaa
> chmod 600 aaa
> ls -l aaa
rw------- ...
> chmod 0600 aaa
rw------- ...
So, no idea what are we missing ? Where, in the code, is ircd modifying permissions ?

Posted: Wed Jan 04, 2006 9:08 pm
by Syzop
I seriously doubt an endian problem.
Did you properly do the make clean and make ?

The call is in ircd.c:1237:
chmod(CPATH, DEFAULT_PERMISSIONS);

and DEFAULT_PERMISSIONS is an #define in include/setup.h

chmod is nowhere declared but taken from header files, so that would suggest a proper definition too.

AFAICT it is impossible that Unreal is at fault here.

Posted: Wed Jan 04, 2006 9:16 pm
by ybart
Unfortunately, I really done the make clean and the make correctly.

However, thanks for information about code. I also heavily believe that is not endian problem, but that was the only thing which cames in mind.

However, I will try to investigate this (adding some printf).

I believe is not at fault here, that is probably some weird incompatibility, I will try to start here, and I'll see...

The only two facts I have :
./configure is properly done
permissions are broken on for configuration files, and only after ircd was launched.

I keep you informed of my investigation.

Posted: Wed Jan 04, 2006 9:21 pm
by Syzop
Ok, thanks :)

Posted: Wed Jan 04, 2006 9:55 pm
by ybart

Code: Select all

#include <sys/file.h>

int main() {
        chmod("chmod.test", 600);
}
That code gives me the bad thing...

Code: Select all

int main() {
        chmod("chmod.test", 0600);
}
And this one is right :D

So I understand, whether I set 600 or 0600, I always get
#define DEFAULT_PERMISSION 600

Maybe we should use S_IRUSR & S_IWUSR.
Because I have no idea how the leading 0 could have disappeared, since I am not comfortable dealing with configure... ^^

For the moment, I will just add the zero myself, but in fact I would be happy to make that work using Config :D

Posted: Wed Jan 04, 2006 10:03 pm
by Syzop
You mean the #define DEFAULT_PERMISSIONS in include/setup.h is '600' for you instead of '0600', even though you said to configure it should be '0600' ?
Interesting.. ;p

The preceeding 0 is important, yes, because it means the value is an octal value.

Maybe something went wrong in configure indeed.. strange..

Posted: Wed Jan 04, 2006 10:11 pm
by ybart
That precisely that, really strange, but dealing with shell is painful for me. But I will still try to investigate. I think the error is not in
cat >>confdefs.h...

May be in sed or around there :?

Posted: Thu Jan 05, 2006 1:11 am
by ybart
Here is the buggy code (configure:348) :

Code: Select all

expr "x--with-permissions=0600" : 'x[^=]*=\(.*\)'
I don't really understand why expr removes the leading 0 on my machine (can we work around that ?).

I don't know where to find next.

Time to sleep.
Bye :D

Re: Mac OS X Installation

Posted: Sat Feb 04, 2006 12:32 am
by BuildSmart
ybart wrote:I had installed Unrealircd for a Mac OS X box. I had to modify manually Makefile and add -lindl in LDFLAGS.

Then I copied example.conf and renamed it unrealircd.conf as required.

When I tried to launch unreal (unreal start). I got that

Code: Select all

* Loading IRCd configuration ..
[error] Couldn't open "unrealircd.conf": Permission denied
[error] Could not load config file unrealircd.conf
[error] IRCd configuration failed to load
Possible error encountered (IRCd seemily not started)
So, I tried using sudo, and this worked (despite errors in my yet unchanged configuration file). I thought this permission deny was not normal. So I tried to investigate.

I did 'ls -l unrealircd.conf' and got ---x-wx--T.
I had effictively no read right on this file. So I chmod 600 it. But nothing changed, since ircd restored ---x-wx--T before loading the config file.

I had no more ideas, and moreover, I don't understand that T added by ircd.

So, how to cleanly get rid of this permission problem ? Do I really need to run it as root ?

Thanks.
I've been very successfull in getting IRCd installed and running in Mac OSX.

There were several small issues with the Config process that I didn't like but there are work arounds, processing a value with expr expects a decimal number and as such if you do
'a=0600; echo "$a";b=$(expr $a + 10); echo "$b"
you will see that the leading 0 is dropped whenever the value is manipulated using 'expr'

The biggest issue that your experiencing is that the software isn't entirely configurable with regards to installed location unless you do some work yourself.

I've managed to build and install the software in /usr/local/unreal and /etc/unreal with great success, to avoid breaking the software due to an Apple OS upgrade, I've build the entire package as static (they say it doesn't but this is due to their build process) and have not been experiencing any issues with running the software.

I did build a shared version because I'm seeing some other issues but this didn't seem to have any impact on the other issue so I've resorted to the static version to keep it as dependancy free as possible.

If you would like some help with it you can contact me off list and we can take it from there.

-- Dale

Posted: Sat Feb 04, 2006 1:03 pm
by Syzop
Dear BuildSmart, like I have said clearly before, if you would like to see a certain bug fixed, report it at http://bugs.unrealircd.org/. Along with a description of the problem and the original ./Config output (maybe attach config.log too), and seeing you fixed it yourself: also an explanation what you think is wrong and how you fixed it.
Otherwise, a bug is never going to be fixed, and you are the only one with a fixed version.

That said, ./Config works perfectly fine on Linux/FBSD/etc and you can install the ircd in any location (where you have write access to), which many people/networks do. Apparently this is OS X specific (though it might hit a few other obscure OS's as well).

It's quite simple, so again for everyone (not just you), ALL BUGS MUST GO TO http://bugs.unrealircd.org. As mentioned in the very first sticky post in this section 'How to get support'.

Otherwise we simply forget about them (or simply never even hear about it, or insufficient info, etc).

Bugreports are appreciated (and fixes even more), but pleeeeeeeease report them at the right place.