aports/main/freeradius/radiusd.initd
Jakub Jirutka 8ff923bf0b main/freeradius: don't force supervise-daemon
Users can enable supervise-daemon simply by declaring
`supervisor=supervise-daemon` in /etc/conf.d/radiusd.

See my mail from Tue, 15 Dec 2020 15:33:16 +0100 in alpine-devel
mailing-list in topic "Use of supervise-daemon in Alpine".
(I cannot simply reference it from ML archive because it's broken.)

This partially reverts 1a33da0225.
2021-01-04 20:42:19 +01:00

48 lines
980 B
Bash

#!/sbin/openrc-run
name="FreeRADIUS"
description_checkconfig="Check configuration"
description_reload="Reload configuration"
extra_commands="checkconfig"
extra_started_commands="reload"
: ${cfgfile:="/etc/raddb/radiusd.conf"}
cfgname="${cfgfile##*/}"
command="/usr/sbin/radiusd"
# RADIUSD_OPTS is for backward compatibility only
command_args="-f -d ${cfgfile%/*} -n ${cfgname%.conf} ${command_args:-$RADIUSD_OPTS}"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
required_files="$cfgfile"
depend() {
need net
after firewall
use dns
}
start_pre() {
# XXX: Is this still needed?
checkpath -d -m 0755 -o radius:radius /run/radiusd
checkconfig
}
checkconfig() {
ebegin "Checking $name configuration"
$command $command_args -C || $command $command_args -Cx -lstdout
eend $?
}
reload () {
ebegin "Reloading $name"
if [ "$supervisor" ]; then
$supervisor "$RC_SVCNAME" --signal HUP
else
start-stop-daemon --signal HUP --pidfile "$pidfile"
fi
eend $?
}