From eab4366a4445b5a5850060c548c99cffe6b1cf8a Mon Sep 17 00:00:00 2001 From: Matthew Newton Date: Fri, 18 Dec 2015 15:47:48 +0000 Subject: [PATCH] Add systemd support for Debian Jessie Apparently it is moving a step forward to break convenience. So systemd users will have to manually update the system to use /usr/local/etc/freeradius themselves if that is where their config is located. --- debian/freeradius.default | 17 +++++++++++++---- debian/freeradius.init | 4 ++++ debian/freeradius.service | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 debian/freeradius.service diff --git a/debian/freeradius.default b/debian/freeradius.default index 17d93cdeaa0..ac4cb68636d 100644 --- a/debian/freeradius.default +++ b/debian/freeradius.default @@ -1,6 +1,15 @@ -# Options for the FreeRADIUS deamon. +# Options passed to the FreeRADIUS deamon. +# +FREERADIUS_OPTIONS="" + + +# If FreeRADIUS is being used on a SysVinit system +# and FREERADIUS_OPTIONS has not been set and the +# following location exists, then it will be used +# for the config directory rather than the default. +# +# This option has no effect when systemd is in +# use, or if FREERADIUS_OPTIONS is set above. +# FREERADIUS_CONF_LOCAL="/usr/local/etc/freeradius" -if [ -d "$FREERADIUS_CONF_LOCAL" ]; then - FREERADIUS_OPTIONS="-d $FREERADIUS_CONF_LOCAL" -fi diff --git a/debian/freeradius.init b/debian/freeradius.init index a281e6236dd..046aee8c2fa 100755 --- a/debian/freeradius.init +++ b/debian/freeradius.init @@ -42,6 +42,10 @@ if [ ! -d /var/run/freeradius ]; then chown freerad:freerad /var/run/freeradius fi +if [ -d "$FREERADIUS_CONF_LOCAL" -a -z "$FREERADIUS_OPTIONS" ]; then + FREERADIUS_OPTIONS="-d $FREERADIUS_CONF_LOCAL" +fi + export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" ret=0 diff --git a/debian/freeradius.service b/debian/freeradius.service new file mode 100644 index 00000000000..43eb3d0a044 --- /dev/null +++ b/debian/freeradius.service @@ -0,0 +1,16 @@ +[Unit] +Description=FreeRADIUS multi-protocol policy server +After=syslog.target network.target +Documentation=man:radiusd(8) man:radiusd.conf(5) http://wiki.freeradius.org/ http://networkradius.com/doc/ + +[Service] +Type=forking +PIDFile=/run/freeradius/freeradius.pid +EnvironmentFile=-/etc/default/freeradius +ExecStartPre=/usr/sbin/freeradius $FREERADIUS_OPTIONS -Cxm -lstdout +ExecStart=/usr/sbin/freeradius $FREERADIUS_OPTIONS +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target -- 2.47.3