Page 1 of 1
init.d script no longer works
Posted: Tue Mar 16, 2010 1:46 pm
by funnyfingers
I am working on migrating unreal from one server to another and while writing up my own documentation for a smooth transition I found that version 3.2.8.1 doesn't behave the same as an init.d daemon (not sure if that is the best term to use). I get Permission Denied, though I can start it fine as root. I understand that it is recommended not to run it as root and will work to set it up to run as a different username, but just want to know what could be different where it would now give this error? If need be I will set it up as a cron job, but would prefer to use the init.d script that I have. A previous version of unrealircd worked fine this way. I don't know the exact version but am pretty sure it is 3.2.X.
Thanks!
Re: init.d script no longer works
Posted: Tue Mar 16, 2010 5:02 pm
by funnyfingers
I am not certain but I think my current install is 3.2.3 and also did not have parameters like it does now, like start for example. Though I did try to add the parameter to the init.d script.
Re: init.d script no longer works
Posted: Tue Mar 16, 2010 7:59 pm
by Syzop
(The official) UnrealIRCd does not ship with any init.d script. Perhaps you used an unreal package (like from a linux dist.) that did?
As for parameters or not... perhaps you got these two things confused:
1) There's the script 'unreal' which is a bash script, './unreal start' is used to start unreal, the script then calls the ircd binary which launches the ircd. The script also has several other options like './unreal stop', etc...
2) There's the 'ircd' binary (which may have a different name, btw) which you could also call - like... without any parameters - to start UnrealIRCd.
As for root or not, that depends, like if you use IRC_UID/IRC_GID (include/config.h), and/or chrooting. If you use these (with or without chrooting) then it's perfectly fine to start the ircd as root, as it will change the uid/gid (again, see include/config.h for all details).
Re: init.d script no longer works
Posted: Tue Mar 16, 2010 8:23 pm
by funnyfingers
The init.d script is the skeleton script that comes with Debian and has been working fine.
It must not like the Unreal script then. I thought that was the binary. I will try it again tonight and let you know how it turns out. Thanks!
Re: init.d script no longer works
Posted: Tue Mar 16, 2010 11:04 pm
by funnyfingers
Thanks for pointing out that unreal was just a script. I modified to point to the binary. The real problem was that the newly created init.d script was not executable so I fixed that and works like a charm, thanks!
Re: init.d script no longer works
Posted: Mon Mar 22, 2010 4:53 pm
by funnyfingers
As I am seeing some possible misinformation on the subject, I would like to point out that you can change what user the start-stop-daemon runs the binary as with the –chuid switch. If you are interestied I could upload an entire script for others to use. Just a personal preference, but I like running it as a service over using the crontab.