3 # radiusd Start/Stop the FreeRADIUS daemon
6 # description: Extensible, configurable, high performance RADIUS server.
10 # Required-Start: $network
14 # Should-Start: $time $syslog mysql ldap postgresql samba krb5-kdc
16 # Short-Description: FreeRADIUS server
17 # Description: Extensible, configurable, high performance RADIUS server.
20 # Source function library.
22 # Get the wrappers for the standard lsb init functions
23 . /lib/lsb/init-functions
25 # and the distro specific ones
26 . /etc/init.d/functions
30 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
32 exec=${exec:=/usr/sbin/$prog}
33 config_dir=${config_dir:=/etc/raddb}
34 config=${config:=$config_dir/radiusd.conf}
35 pidfile=${pidfile:=/var/run/$prog/$prog.pid}
36 lockfile=${lockfile:=/var/lock/subsys/radiusd}
39 echo -n $"Checking $prog configuration: "
40 out=`$exec -Cxl stdout -d $config_dir`; retval=$?
41 out=`echo "${out}" | tail -n 1 | sed 's/^\s*ERROR:\s*\(.*\)\s*$/\1/'`
43 # Seems some LSB function implementations *really* need
44 # a log message < 60 chars long, else output gets mangled.
45 if [ $retval -eq 0 ]; then
48 if [ $(expr length "$out") -gt 60 ]; then
52 log_failure_msg "$out"
59 echo -n $"Starting $prog: "
61 if [ ! -x $exec ]; then
62 log_failure_msg "$exec not found or not executable"
66 if [ ! -f $config ]; then
67 log_failure_msg "Can't find radiusd.conf"
71 start_daemon -p $pidfile $exec -d $config_dir
73 if [ $retval -eq 0 ]; then
82 echo -n $"Stopping $prog: "
83 killproc -p $pidfile $prog
85 if [ $retval -eq 0 ]; then
100 # radiusd may not be capable of a 100% configuration reload depending
101 # on which loadable modules are in use, if sending the server a
102 # HUP is not sufficient then use restart here instead. However, we
103 # prefer by default to use HUP since it's what is usually desired.
107 kill -HUP `pidofproc -p $pidfile $prog`
115 # run checks to determine if the service is running or use generic status
116 status -p $pidfile $prog
120 rh_status >/dev/null 2>&1
125 rh_status_q && exit 0
126 configtest || exit 150
131 rh_status_q || exit 0
136 configtest || exit 150
141 rh_status_q || exit 7
142 configtest || exit 150
147 configtest || exit 150
151 condrestart|try-restart)
152 configtest || exit 150
153 rh_status_q || exit 0
157 configtest|testconfig)
158 configtest || exit 150
162 echo -n $"Debugging $prog: "
164 log_failure_msg "$prog already running; for live debugging see raddebug(8)"
169 $exec -X -d $config_dir || exit $?
173 echo -n $"Debugging $prog: "
175 log_failure_msg "$prog already running; for live debugging see raddebug(8)"
180 $exec -f -xx -l stdout -d $config_dir || exit $?
188 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest|debug|debug-threaded}"