summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel M. Weeks <dan@danweeks.net>2020-11-02 11:53:58 -0500
committerMatt Turner <mattst88@gentoo.org>2020-11-06 16:00:48 -0500
commit0823e666186e722c7786a6ae5caaec47ee2b982e (patch)
treee2ae38d56394c7f24daf7931640a31ced621a8d1 /net-dialup/freeradius/files/radius.init-r4
parentapp-arch/brotli: Cleanup old versions (diff)
downloadgentoo-0823e666186e722c7786a6ae5caaec47ee2b982e.tar.gz
gentoo-0823e666186e722c7786a6ae5caaec47ee2b982e.tar.bz2
gentoo-0823e666186e722c7786a6ae5caaec47ee2b982e.zip
net-dialup/freeradius: Support alternate log path in initscript
Closes: https://github.com/gentoo/gentoo/pull/18112 Signed-off-by: Daniel M. Weeks <dan@danweeks.net> Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'net-dialup/freeradius/files/radius.init-r4')
-rw-r--r--net-dialup/freeradius/files/radius.init-r431
1 files changed, 31 insertions, 0 deletions
diff --git a/net-dialup/freeradius/files/radius.init-r4 b/net-dialup/freeradius/files/radius.init-r4
new file mode 100644
index 000000000000..dee1842e5cbf
--- /dev/null
+++ b/net-dialup/freeradius/files/radius.init-r4
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/radiusd
+command_args="${RADIUSD_OPTS}"
+pidfile="${pidfile:-/run/radiusd/radiusd.pid}"
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ use dns
+}
+
+start_pre() {
+ if [ ! -f /etc/raddb/radiusd.conf ] ; then
+ eerror "No /etc/raddb/radiusd.conf file exists!"
+ return 1
+ fi
+
+ checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
+ $(dirname ${pidfile}) "${RADIUSD_LOGPATH:-/var/log/radius}"
+ checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
+ $(dirname ${pidfile}) /run/radiusd
+}
+
+reload() {
+ ebegin "Reloading radiusd"
+ kill -HUP $(cat ${pidfile})
+ eend $?
+}