2 # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany.
3 # 2002, 2003 SuSE Linux AG, Nuernberg, Germany.
5 # Author: Wolfgang Rosenauer, 2000-2003
9 # and symbolic its link
15 # Required-Start: $network $syslog $remotefs
16 # Should-Start: $time ypbind smtp
17 # Required-Stop: $syslog $remote_fs
18 # Should-Stop: ypbind smtp
20 # Default-Stop: 0 1 2 6
21 # Short-Description: RADIUS-Server
22 # Description: Remote Authentication Dialin User Server
25 . /etc/init.d/functions
29 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
31 exec=${exec:=/usr/sbin/$prog}
32 config_dir=${config_dir:=/etc/raddb}
34 test -x "$exec" || { echo "$exec not installed"; \
35 if [ "$1" = "stop" ]; then exit 0;
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 [ $retval -ne 0 ] && echo "$out" 1>&2
51 configtest || { rc_failed 150; rc_exit; }
52 echo -n "Starting RADIUS daemon "
53 startproc $exec >/dev/null
58 echo -n "Shutting down RADIUS daemon "
63 try-restart|condrestart)
64 # If first returns OK call the second, if first or second command fails, set echo return value.
65 if test "$1" = "condrestart"; then
66 echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
72 rc_reset # Not running is not a failure.
78 # Stop the service and regardless of whether it was running or not, start it again.
79 configtest || { rc_failed 150; rc_exit; }
86 # Signal the daemon to reload its config. Most daemons o this on signal 1 (SIGHUP).
87 # If it does not support it, restart.
88 configtest || { rc_failed 150; rc_exit; }
89 echo -n "Reload RADIUS daemon "
95 # Like force-reload, but if daemon does not support signalling, do nothing (!)
96 configtest || { rc_failed 150; rc_exit; }
97 echo -n "Reload RADIUS daemon "
103 echo -n "Checking for service radiusd "
108 configtest|testconfig)
115 if [ $? -eq 0 ]; then
116 echo -n "$prog already running; for live debugging see raddebug(8)"
119 $exec -X -d "$config_dir" || exit $?
125 if [ $? -eq 0 ]; then
126 echo -n "$prog already running; for live debugging see raddebug(8)"
129 $exec -f -xx -l stdout -d "$config_dir" || exit $?
134 echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|configtest|debug|debug-threaded}"