Blame | Last modification | View Log | RSS feed
#!/bin/sh## radiusd Start/Stop the FreeRADIUS daemon## chkconfig: - 88 10# description: Extensible, configurable, high performance RADIUS server.### BEGIN INIT INFO# Provides: radiusd# Required-Start: $network# Required-Stop:# Default-Start:# Default-Stop:# 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# Source function library.. /etc/rc.d/init.d/functionsprog=radiusd[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$progexec=${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}start() {[ -x $exec ] || exit 5[ -f $config ] || exit 6echo -n $"Starting $prog: "daemon --pidfile $pidfile $exec -d $config_dirretval=$?echo[ $retval -eq 0 ] && touch $lockfilereturn $retval}stop() {echo -n $"Stopping $prog: "killproc -p $pidfile $progretval=$?echo[ $retval -eq 0 ] && rm -f $lockfilereturn $retval}restart() {stopstart}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.## restartkill -HUP `pidofproc -p $pidfile $prog`}force_reload() {restart}rh_status() {# run checks to determine if the service is running or use generic statusstatus -p $pidfile $prog}rh_status_q() {rh_status >/dev/null 2>&1}case "$1" instart)rh_status_q && exit 0$1;;stop)rh_status_q || exit 0$1;;restart)$1;;reload)rh_status_q || exit 7$1;;force-reload)force_reload;;status)rh_status;;condrestart|try-restart)rh_status_q || exit 0restart;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"exit 2esacexit $?