diff options
Diffstat (limited to 'debian/tacplusd.init')
-rw-r--r-- | debian/tacplusd.init | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/debian/tacplusd.init b/debian/tacplusd.init new file mode 100644 index 0000000..71b06d8 --- /dev/null +++ b/debian/tacplusd.init @@ -0,0 +1,56 @@ +#!/bin/bash +# +### BEGIN INIT INFO +# Provides: tacplusd +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: +# Default-Stop: +# Short-Description: start and stop Tacplus daemon +### END INIT INFO +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +. /lib/lsb/init-functions + +DAEMON=/usr/sbin/tacplusd +PIDFILE=/var/run/tacplusd.pid +OPTIONS= + +case $1 in + start) + log_daemon_msg "Starting TACACS+ daemon" "tacplusd" + start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \ + --startas $DAEMON -- -p $PIDFILE $OPTIONS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping TACACS+ daemon" "tacplusd" + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE + log_end_msg $? + rm -f $PIDFILE + rm -r $ENVFILE + ;; + restart|force-reload) + $0 stop && sleep 2 && $0 start + ;; + try-restart) + if $0 status >/dev/null; then + $0 restart + else + exit 0 + fi + ;; + reload) + pkill -HUP tacplusd + ;; + status) + status_of_proc $DAEMON "TACACS+ daemon server" + ;; + *) + echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 2 + ;; +esac + |