summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/xinetd/xinetd/xinetd.init
blob: 26dbea74159dbd8cad319f5ff80f988cf5d6c2fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# /etc/init.d/xinetd  --  script to start and stop xinetd.

if test -f /etc/default/xinetd; then
	. /etc/default/xinetd
fi


test -x /usr/sbin/xinetd || exit 0

checkportmap () {
  if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
    if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
      echo
      echo "WARNING: portmapper inactive - RPC services unavailable!"
      echo "    Commenting out or removing the RPC services from"
      echo "    the /etc/xinetd.conf file will remove this message."
      echo
    fi
  fi
} 

case "$1" in
    start)
        checkportmap
	echo -n "Starting internet superserver: xinetd"
	start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
	echo "."
	;;
    stop)
	echo -n "Stopping internet superserver: xinetd"
	start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd
	echo "."
	;;
    reload)
	echo -n "Reloading internet superserver configuration: xinetd"
	start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
	echo "."
	;;
    force-reload)
	echo "$0 force-reload: Force Reload is deprecated"
	echo -n "Forcefully reloading internet superserver configuration: xinetd"
	start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
	echo "."
	;;
    restart)
	$0 stop
	$0 start
	;;
    *)
	echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}"
	exit 1
	;;
esac

exit 0