2008-02-29 04:16:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2009-12-03 21:44:54 +00:00
|
|
|
# radiusd Start/Stop the FreeRADIUS daemon
|
2008-02-29 04:16:24 +00:00
|
|
|
#
|
2009-12-03 21:44:54 +00:00
|
|
|
# chkconfig: - 88 10
|
|
|
|
# description: Extensible, configurable, high performance RADIUS server.
|
|
|
|
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: radiusd
|
|
|
|
# Required-Start: $network
|
|
|
|
# Required-Stop:
|
2009-12-19 20:10:12 +00:00
|
|
|
# Default-Start:
|
|
|
|
# Default-Stop:
|
2009-12-03 21:44:54 +00:00
|
|
|
# Should-Start: $time $syslog mysql ldap postgresql samba krb5-kdc
|
|
|
|
# Should-Stop:
|
|
|
|
# Short-Description: FreeRADIUS server
|
|
|
|
# Description: Extensible, configurable, high performance RADIUS server.
|
|
|
|
### END INIT INFO
|
2008-02-29 04:16:24 +00:00
|
|
|
|
|
|
|
# Source function library.
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2009-12-03 21:44:54 +00:00
|
|
|
prog=radiusd
|
|
|
|
|
|
|
|
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
|
|
|
|
2010-01-08 17:55:23 +00:00
|
|
|
exec=${exec:=/usr/sbin/$prog}
|
|
|
|
config_dir=${config_dir:=/etc/raddb}
|
|
|
|
config=${config:=$config_dir/radiusd.conf}
|
|
|
|
pidfile=${pidfile:=/var/run/$prog/$prog.pid}
|
|
|
|
lockfile=${lockfile:=/var/lock/subsys/radiusd}
|
|
|
|
|
2009-12-03 21:44:54 +00:00
|
|
|
start() {
|
|
|
|
[ -x $exec ] || exit 5
|
|
|
|
[ -f $config ] || exit 6
|
|
|
|
echo -n $"Starting $prog: "
|
2010-01-08 17:55:23 +00:00
|
|
|
daemon --pidfile $pidfile $exec -d $config_dir
|
2009-12-03 21:44:54 +00:00
|
|
|
retval=$?
|
|
|
|
echo
|
|
|
|
[ $retval -eq 0 ] && touch $lockfile
|
|
|
|
return $retval
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo -n $"Stopping $prog: "
|
|
|
|
killproc -p $pidfile $prog
|
|
|
|
retval=$?
|
|
|
|
echo
|
|
|
|
[ $retval -eq 0 ] && rm -f $lockfile
|
|
|
|
return $retval
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
2008-02-29 04:16:24 +00:00
|
|
|
|
2009-12-03 21:44:54 +00:00
|
|
|
reload() {
|
|
|
|
# radiusd may not be capable of a 100% configuration reload depending
|
|
|
|
# on which loadable modules are in use, if sending the server a
|
|
|
|
# HUP is not sufficient then use restart here instead. However, we
|
|
|
|
# prefer by default to use HUP since it's what is usually desired.
|
|
|
|
#
|
|
|
|
# restart
|
|
|
|
|
|
|
|
kill -HUP `pidofproc -p $pidfile $prog`
|
|
|
|
}
|
|
|
|
|
|
|
|
force_reload() {
|
|
|
|
restart
|
|
|
|
}
|
|
|
|
|
|
|
|
rh_status() {
|
|
|
|
# run checks to determine if the service is running or use generic status
|
|
|
|
status -p $pidfile $prog
|
|
|
|
}
|
|
|
|
|
|
|
|
rh_status_q() {
|
|
|
|
rh_status >/dev/null 2>&1
|
|
|
|
}
|
2008-02-29 04:16:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
2009-12-03 21:44:54 +00:00
|
|
|
start)
|
|
|
|
rh_status_q && exit 0
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
rh_status_q || exit 0
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$1
|
2008-02-29 04:16:24 +00:00
|
|
|
;;
|
2009-12-03 21:44:54 +00:00
|
|
|
reload)
|
|
|
|
rh_status_q || exit 7
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
force-reload)
|
|
|
|
force_reload
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
rh_status
|
|
|
|
;;
|
|
|
|
condrestart|try-restart)
|
|
|
|
rh_status_q || exit 0
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
|
|
|
exit 2
|
2008-02-29 04:16:24 +00:00
|
|
|
esac
|
2009-12-03 21:44:54 +00:00
|
|
|
exit $?
|