unrealircd: don't have checkconfig accidentally start the server

This commit is contained in:
Brian S. Stephan 2023-04-11 14:32:51 -05:00
parent 56678e5ece
commit 26e4c0d022
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
1 changed files with 14 additions and 1 deletions

View File

@ -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}" \