Logo Search packages:      
Sourcecode: tac-plus version File versions  Download package

init.d

#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          tac-plus
# Required-Start:    $network
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: Start tac-plus server.
# Description:       Run the tac-plus server listening for 
#                    AAA ( access, acounting and autorization request )
#                    from routers or RAS (remote access servers) via
#                    tacacs+ protocol
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/tac_plus
NAME=tac_plus
DESC="Tacacs+ server"
OTHER_OPTS="-d 248"
CONFIG_FILE="/etc/tac-plus/tacacs.conf"
DAEMON_USER="tacacs"

test -f $DAEMON || exit 0

if [ -r /etc/default/tac-plus ] ; then
      . /etc/default/tac-plus
fi

DAEMON_OPTS="-C $CONFIG_FILE -U $DAEMON_USER $OTHER_OPTS" 
#set -e

case "$1" in
  start)
      echo -n "Starting $DESC: "
      start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
            --exec $DAEMON -- $DAEMON_OPTS
      echo "$NAME."
      ;;
  stop)
      echo -n "Stopping $DESC: "
      start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
            --exec $DAEMON
      echo "$NAME."
      ;;
  #reload)
      #
      #     The daemon AFAIK have problems reloading its 
      #     config files on the fly. When sending the signal
      #     it dies trying to bind again to the socket.
      #     So it has been disabled.
      # echo "Reloading $DESC configuration files."
      # start-stop-daemon --stop --signal FIXME --quiet --pidfile \
      #     /var/run/$NAME.pid --exec $DAEMON
  #;;
  restart|force-reload)
      #
      echo -n "Restarting $DESC: "
      start-stop-daemon --stop --quiet --pidfile \
            /var/run/$NAME.pid --exec $DAEMON
      sleep 1
      start-stop-daemon --start --quiet --pidfile \
            /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
      echo "$NAME."
      ;;
  *)
      N=/etc/init.d/$NAME
      # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
      echo "Usage: $N {start|stop|restart|force-reload}" >&2
      exit 1
      ;;
esac

exit 0

Generated by  Doxygen 1.6.0   Back to index