The unrealircd init script cannot start unrealircd, but I can start it just fine from the command line directly. #/etc/init.d/unrealircd start * Starting unrealircd ... * start-stop-daemon: failed to start `/usr/bin/unrealircd' [ !! ] * ERROR: unrealircd failed to start #unrealircd WARNING: You are running UnrealIRCd as root and it is not configured to drop priviliges. This is _very_ dangerous, as any compromise of your UnrealIRCd is the same as giving a cracker root SSH access to your box. You should either start UnrealIRCd under a different account than root, or set IRC_USER in include/config.h to a nonprivileged username and recompile. _ _ _ ___________ _____ _ | | | | | |_ _| ___ \/ __ \ | | | | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| | | | | | '_ \| '__/ _ \/ _` | | | | | / | | / _` | | |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| | \___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_| v3.2.10.4 using TRE 0.8.0 (BSD) using OpenSSL 1.0.2d 9 Jul 2015 using zlib 1.2.8 * Loading IRCd configuration .. * Configuration loaded without any problems .. * Initializing SSL. * Dynamic configuration initialized .. booting IRCd. --------------------------------------------------------------------- Reproducible: Always
I suspect some sort of permissions problem. /var/log/syslog: Sep 18 11:54:20 metalhead /etc/init.d/unrealircd[28728]: start-stop-daemon: failed to start `/usr/bin/unrealircd' Sep 18 11:54:20 metalhead /etc/init.d/unrealircd[28714]: ERROR: unrealircd failed to start /var/log/daemon: Sep 18 11:54:20 metalhead /etc/init.d/unrealircd[28728]: start-stop-daemon: failed to start `/usr/bin/unrealircd' Sep 18 11:54:20 metalhead /etc/init.d/unrealircd[28714]: ERROR: unrealircd failed to start /var/log/auth: Sep 18 11:54:20 metalhead start-stop-daemon: pam_unix(start-stop-daemon:session): session opened for user unrealircd by root(uid=0) ls -l /etc/unrealircd: drwxr-x--- 2 root unrealircd 4096 Sep 18 11:40 aliases -rw------- 1 root unrealircd 1175 Sep 18 11:39 badwords.channel.conf -rw------- 1 root unrealircd 1183 Sep 18 11:39 badwords.message.conf -rw------- 1 root unrealircd 1121 Sep 18 11:39 badwords.quit.conf -rw-r----- 1 root unrealircd 1844 Sep 18 11:39 dccallow.conf -rw------- 1 root unrealircd 52526 Sep 18 11:39 help.conf -rw-r----- 1 unrealircd root 1021 Sep 18 11:40 server.cert.crt -rw-r----- 1 unrealircd root 737 Sep 18 11:40 server.cert.csr -rw-r----- 1 unrealircd root 887 Sep 18 11:40 server.cert.key -rw-r----- 1 unrealircd root 1909 Sep 18 11:40 server.cert.pem lrwxrwxrwx 1 root root 15 Sep 18 11:40 server.key.pem -> server.cert.key -rw------- 1 root unrealircd 5597 Sep 18 11:39 spamfilter.conf lrwxrwxrwx 1 root unrealircd 19 Sep 18 11:40 tmp -> /var/lib/unrealircd -rw------- 1 root unrealircd 20425 Sep 18 11:43 unrealircd.conf
Created attachment 412218 [details] emerge --info
Removing the "--user" part of the initscript made it work...
Created attachment 412590 [details] strace log Choked on bad permissions, couldn't write to /var/log/unrealircd
I deleted /var/log/unrealircd and reinstalled. Everything worked. Suggested fix: When installing, verify correct permissions on /var/log/unrealircd if it already exists.
I had the same symptoms. To make it run as user unrealircd I did. $ USE="-ipv6" emerge -v unrealircd $ uname -sr Linux 4.4.8-hardened-r1 $ grep IPV6 /usr/src/linux/.config CONFIG_IPV6=m # CONFIG_IPV6_ROUTER_PREF is not set # CONFIG_IPV6_OPTIMISTIC_DAD is not set # CONFIG_IPV6_MIP6 is not set # CONFIG_IPV6_ILA is not set # CONFIG_IPV6_VTI is not set CONFIG_IPV6_SIT=m # CONFIG_IPV6_SIT_6RD is not set CONFIG_IPV6_NDISC_NODETYPE=y # CONFIG_IPV6_TUNNEL is not set # CONFIG_IPV6_GRE is not set # CONFIG_IPV6_MULTIPLE_TABLES is not set # CONFIG_IPV6_MROUTE is not set # CONFIG_NF_DEFRAG_IPV6 is not set # CONFIG_NF_CONNTRACK_IPV6 is not set # CONFIG_NF_DUP_IPV6 is not set # CONFIG_NF_REJECT_IPV6 is not set CONFIG_NF_LOG_IPV6=m
(In reply to sebaFlame from comment #6) > I had the same symptoms. To make it run as user unrealircd I did. > $ USE="-ipv6" emerge -v unrealircd > > $ uname -sr > Linux 4.4.8-hardened-r1 > $ grep IPV6 /usr/src/linux/.config > CONFIG_IPV6=m > # CONFIG_IPV6_ROUTER_PREF is not set > # CONFIG_IPV6_OPTIMISTIC_DAD is not set > # CONFIG_IPV6_MIP6 is not set > # CONFIG_IPV6_ILA is not set > # CONFIG_IPV6_VTI is not set > CONFIG_IPV6_SIT=m > # CONFIG_IPV6_SIT_6RD is not set > CONFIG_IPV6_NDISC_NODETYPE=y > # CONFIG_IPV6_TUNNEL is not set > # CONFIG_IPV6_GRE is not set > # CONFIG_IPV6_MULTIPLE_TABLES is not set > # CONFIG_IPV6_MROUTE is not set > # CONFIG_NF_DEFRAG_IPV6 is not set > # CONFIG_NF_CONNTRACK_IPV6 is not set > # CONFIG_NF_DUP_IPV6 is not set > # CONFIG_NF_REJECT_IPV6 is not set > CONFIG_NF_LOG_IPV6=m IPV6 issues sound like a separate bug from the permissions problem I found. Could you file a new bug about this?
What I’m going to bet happened is you tried to run unrealircd manually as root prior to trying to use the initscripts. As files are created with the owner/group of the process creating them, this would have created the ircd.log file with the wrong ownership information. I’ve added an elog to unrealircd-4.0.5 warning against this, but I’m not really sure if this is something that can be fixed as it is user error :-p. Could add some automatic perms fixing to the initscript, but I think the script is already complicated enough… Oh, I know, I can just precreate the logfile and tunefile in pkg_postinst() with the correct owner. Then the file will already exist and running unrealircd incorrectly as root won’t create it wrong. I’ll change that shortly…
I’ve put the precreation strategy in the tree. So now you should be able to install unrealircd, run it as root, realize your mistake and kill it, and then switch to launching it with the initscripts with no problem (other than needing to set up the config properly of course).