diff --git a/net-irc/unrealircd/files/unrealircd.initd-r4 b/net-irc/unrealircd/files/unrealircd.initd-r4 index 7437b30..d7398a5 100644 --- a/net-irc/unrealircd/files/unrealircd.initd-r4 +++ b/net-irc/unrealircd/files/unrealircd.initd-r4 @@ -34,7 +34,7 @@ fi checkconfig() { # command_args weirdness because we want to preserve the chroot arguments if it's set # Only run the configtest for the main instance; it can't work right now for others (no way to specify config file) - [ ${SVCNAME} = unrealircd ] && su -s /bin/sh ${command_user:=root} -c "${command} ${command_args%${UNREALIRCD_COMMAND_ARGS}}" configtest + [ ${SVCNAME} = unrealircd ] && su -s /bin/sh ${command_user:=root} -c "${command} ${command_args%${UNREALIRCD_COMMAND_ARGS}} -c" } depend() { @@ -42,7 +42,20 @@ depend() { provide ircd } +# It is unsafe for the unrealircd user to be able to write to its own +# PID file, since root will be sending e.g. kill signals to the PID +# listed in that file. Ensure that we overwrite the ownership and +# permissions on /run/unrealircd from previous init scripts. +start_pre() { + # commented out pending information about where to do pidfile vs. socket stuff + # checkpath --directory --owner root:root --mode 0700 "${UNREALIRCD_CHROOT}"/run/unrealircd + + checkconfig || return $? +} + reload() { + checkconfig || return $? + ebegin "Reloading ${RC_SVCNAME}" start-stop-daemon --signal HUP \ --pidfile "${pidfile}" \