11 # set the location of log files
12 if ! cd /var/log/radius ; then
13 eerror "Failed to change current directory to /var/log/radius"
17 if [ ! -d /var/run/radiusd ] && ! mkdir /var/run/radiusd ; then
18 eerror "Failed to create /var/run/radiusd"
22 if [ ! -f /etc/raddb/radiusd.conf ] ; then
23 eerror "No /etc/raddb/radiusd.conf file exists!"
28 RADIUSD_USER=`grep '^ *user *=' /etc/raddb/radiusd.conf | cut -d ' ' -f 3`
29 RADIUSD_GROUP=`grep '^ *group *=' /etc/raddb/radiusd.conf | cut -d ' ' -f 3`
30 if [ -n "${RADIUSD_USER}" ] && ! getent passwd ${RADIUSD_USER} > /dev/null ; then
31 eerror "${RADIUSD_USER} user missing!"
34 if [ -n "${RADIUSD_GROUP}" ] && ! getent group ${RADIUSD_GROUP} > /dev/null ; then
35 eerror "${RADIUSD_GROUP} group missing!"
39 # radius.log is created before privileges are dropped - need to set proper permissions on it
40 [ -f radius.log ] || touch radius.log || return 1
42 chown -R "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" . /var/run/radiusd && \
43 chmod -R u+rwX,g+rX . /var/run/radiusd || return 1
47 checkconfig || return 1
49 ebegin "Starting radiusd"
50 start-stop-daemon --start --quiet --exec /usr/sbin/radiusd -- ${RADIUSD_OPTS} >/dev/null
55 ebegin "Stopping radiusd"
56 start-stop-daemon --stop --quiet --pidfile=/var/run/radiusd/radiusd.pid
61 ebegin "Reloading radiusd"
62 kill -HUP `</var/run/radiusd/radiusd.pid`