File: inetd.init.d

package info (click to toggle)
netkit-base 0.10-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,492 kB
  • ctags: 1,349
  • sloc: ansic: 9,958; sh: 216; makefile: 129
file content (65 lines) | stat: -rw-r--r-- 1,764 bytes parent folder | download | duplicates (2)
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
58
59
60
61
62
63
64
65
#!/bin/sh
#
# start/stop inetd super server.

if ! [ -x /usr/sbin/inetd ]; then
	exit 0
fi

checkportmap () {
    if grep -v "^ *#" /etc/inetd.conf | grep 'rpc/' >/dev/null; then
        if ! [ -x /usr/bin/rpcinfo ]
        then
            echo
            echo "WARNING: rpcinfo not available - RPC services may be unavailable!"
            echo "         (Commenting out the rpc services in inetd.conf will"
	    echo "         disable this message)"
            echo
        elif ! /usr/bin/rpcinfo -u localhost portmapper >/dev/null 2>/dev/null
        then
            echo
            echo "WARNING: portmapper inactive - RPC services unavailable!"
            echo "         (Commenting out the rpc services in inetd.conf will"
	    echo "         disable this message)"
            echo
        fi
    fi
} 

case "$1" in
    start)
        checkportmap
	echo -n "Starting internet superserver:"
	echo -n " inetd" ; start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    stop)
	echo -n "Stopping internet superserver:"
	echo -n " inetd" ; start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    reload)
	echo -n "Reloading internet superserver:"
	echo -n " inetd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --signal 1
	echo "."
	;;
    force-reload)
	$0 reload
	;;
    restart)
	echo -n "Restarting internet superserver:"
	echo -n " inetd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid
	checkportmap
	start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    *)
	echo "Usage: /etc/init.d/inetd {start|stop|reload|restart}"
	exit 1
	;;
esac

exit 0