~gandelman-a/ubuntu/oneiric/openbsd-inetd/merge

« back to all changes in this revision

Viewing changes to debian/openbsd-inetd.init

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2002-08-20 15:51:39 UTC
  • Revision ID: james.westby@ubuntu.com-20020820155139-y1shmgf3ts6hcxrd
Tags: 0.20020802-1
* New package.
* Pre/postinstall scripts borrowed from aj's netkit-inetd package.
* This package fixes many bugs in netkit-inetd, among them:
  #10813, #32579, #55052, #66752, #143539, #143815, #143816, #125181,
  #45907, #82241, #96544, #110673.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# start/stop inetd super server.
 
4
 
 
5
if ! [ -x /usr/sbin/inetd -o -e /etc/inetd.conf ]; then
 
6
        exit 0
 
7
fi
 
8
 
 
9
checkportmap () {
 
10
    if grep -v "^ *#" /etc/inetd.conf | grep 'rpc/' >/dev/null; then
 
11
        if ! [ -x /usr/bin/rpcinfo ]; then
 
12
            echo
 
13
            echo "WARNING: rpcinfo not available - RPC services may be unavailable!"
 
14
            echo "         (Commenting out the rpc services in inetd.conf will"
 
15
            echo "         disable this message)"
 
16
            echo
 
17
        elif ! /usr/bin/rpcinfo -u localhost portmapper >/dev/null 2>&1; then
 
18
            echo
 
19
            echo "WARNING: portmapper inactive - RPC services unavailable!"
 
20
            echo "         (Commenting out the rpc services in inetd.conf will"
 
21
            echo "         disable this message)"
 
22
            echo
 
23
        fi
 
24
    fi
 
25
 
26
 
 
27
checknoservices () {
 
28
    if ! grep -q "^[0-9A-Za-z/]" /etc/inetd.conf; then
 
29
        echo " no services configured, inetd not started."
 
30
        exit 0
 
31
    fi
 
32
}
 
33
 
 
34
case "$1" in
 
35
    start)
 
36
        checkportmap
 
37
        echo -n "Starting internet superserver:"
 
38
        checknoservices
 
39
        echo -n " inetd"
 
40
        start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
 
41
        echo "."
 
42
        ;;
 
43
    stop)
 
44
        echo -n "Stopping internet superserver:"
 
45
        echo -n " inetd"
 
46
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
 
47
        echo "."
 
48
        ;;
 
49
    reload)
 
50
        echo -n "Reloading internet superserver:"
 
51
        echo -n " inetd"
 
52
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --signal 1
 
53
        echo "."
 
54
        ;;
 
55
    force-reload)
 
56
        $0 reload
 
57
        ;;
 
58
    restart)
 
59
        echo -n "Restarting internet superserver:"
 
60
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid
 
61
        checkportmap
 
62
        checknoservices
 
63
        echo -n " inetd"
 
64
        start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
 
65
        echo "."
 
66
        ;;
 
67
    *)
 
68
        echo "Usage: /etc/init.d/inetd {start|stop|reload|restart}"
 
69
        exit 1
 
70
        ;;
 
71
esac
 
72
 
 
73
exit 0
 
74