prepare upload
[packages/xinetd.git] / debian / xinetd.init
1 #!/bin/sh
2 #
3 # /etc/init.d/xinetd  --  script to start and stop xinetd.
4
5 if test -f /etc/default/xinetd; then
6         . /etc/default/xinetd
7 fi
8
9
10 test -x /usr/sbin/xinetd || exit 0
11
12 checkportmap () {
13   if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
14     if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
15       echo
16       echo "WARNING: portmapper inactive - RPC services unavailable!"
17       echo "    Commenting out or removing the RPC services from"
18       echo "    the /etc/xinetd.conf file will remove this message."
19       echo
20     fi
21   fi
22
23
24 case "$1" in
25     start)
26         checkportmap
27         echo -n "Starting internet superserver: xinetd"
28         start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
29         echo "."
30         ;;
31     stop)
32         echo -n "Stopping internet superserver: xinetd"
33         start-stop-daemon --stop --signal 3 --quiet --oknodo --exec /usr/sbin/xinetd
34         echo "."
35         ;;
36     reload)
37         echo -n "Reloading internet superserver configuration: xinetd"
38         start-stop-daemon --stop --signal 1 --quiet --oknodo --exec /usr/sbin/xinetd
39         echo "."
40         ;;
41     force-reload)
42         echo "$0 force-reload: Force Reload is deprecated"
43         echo -n "Forcefully reloading internet superserver configuration: xinetd"
44         start-stop-daemon --stop --signal 1 --quiet --oknodo --exec /usr/sbin/xinetd
45         echo "."
46         ;;
47     restart)
48         $0 stop
49         $0 start
50         ;;
51     *)
52         echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}"
53         exit 1
54         ;;
55 esac
56
57 exit 0