gentoo-ebuilds/net-irc/unrealircd/files/unrealircd.initd-r4
Anna (navi) Figueiredo Gomes bad2c62afe
net-irc/unrealircd: improve init.d script
the new script uses supervise-daemon and standardized variables, as well as
a fixed checkconfig that works across multiple instances

Bug: https://bugs.gentoo.org/890338
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Part-of: https://github.com/gentoo/gentoo/pull/41755
Closes: https://github.com/gentoo/gentoo/pull/41755
Signed-off-by: Sam James <sam@gentoo.org>
2025-05-23 05:56:52 +01:00

33 lines
672 B
Text

#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
: ${unrealircd_conf:=/etc/unrealircd/${RC_SVCNAME}.conf}
depend() {
use dns net
provide ircd
}
supervisor=supervise-daemon
command=/usr/bin/unrealircd
command_args="-F -f ${unrealircd_conf} ${unrealircd_opts}"
command_user="unrealircd:unrealircd"
extra_started_commands="checkconfig reload"
checkconfig() {
runuser -u "${command_user%%:*}" -- ${command} -c "${unrealircd_conf}"
}
start_pre() {
checkconfig
}
reload() {
checkconfig || return $?
ebegin "Reloading ${RC_SVCNAME}"
supervise-daemon "${RC_SVCNAME}" --signal HUP
eend $?
}