2 # Start/stop the FreeRADIUS daemon.
6 # Required-Start: $network
7 # Should-Start: $time mysql ldap postgresql samba krb5-kdc
9 # Default-Start: 2 3 4 5
11 # Short-Description: FreeRADIUS server
12 # Description: Extensible, configurable, high performance RADIUS server.
17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
18 DESC="FreeRADIUS server"
20 DAEMON=/usr/sbin/$NAME
21 PIDFILE=/var/run/$NAME/$NAME.pid
22 SCRIPTNAME=/etc/init.d/$NAME
24 # Default values for config variables
29 # Exit if the package is not installed
30 [ -x $DAEMON ] || exit 0
32 # Read configuration variable file if it is present
33 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
35 # Load the VERBOSE setting and other rcS variables
38 # Define LSB start_daemon, killproc and log_* functions.
39 . /lib/lsb/init-functions
41 # /var/run may be a tmpfs
42 if [ ! -d /var/run/$NAME ]; then
43 install -o "$FR_USER" -g "$FR_GROUP" -m 0755 -d /var/run/$NAME
45 echo "Error creating the /var/run/$NAME directory."
52 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
53 start_daemon -p $PIDFILE $DAEMON $FR_ARGS
55 [ "$VERBOSE" != no ] && log_end_msg 1 || \
56 log_failure_msg "Run '$DAEMON -X' to find out why."
59 [ "$VERBOSE" != no ] && log_end_msg 0
62 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
63 killproc -p $PIDFILE $DAEMON
65 [ "$VERBOSE" != no ] && log_end_msg 1
68 [ "$VERBOSE" != no ] && log_end_msg 0
71 log_daemon_msg "Restarting $DESC" "$NAME"
72 killproc -p $PIDFILE $DAEMON
75 log_failure_msg "Failed to stop $NAME."
78 start_daemon -p $PIDFILE $DAEMON $FR_ARGS
81 log_failure_msg "Failed to start $NAME."
82 log_failure_msg "Run '$DAEMON -X' to find out why."
88 log_daemon_msg "Reloading $DESC" "$NAME"
89 killproc -p $PIDFILE $DAEMON -SIGHUP
95 pidofproc -p $PIDFILE > /dev/null
98 log_failure_msg "$NAME has died."
104 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2