summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/xinetd/xinetd/xinetd.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/xinetd/xinetd/xinetd.init')
-rw-r--r--meta/recipes-extended/xinetd/xinetd/xinetd.init57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.init b/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 0000000000..26dbea7415
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.init
@@ -0,0 +1,57 @@
1#!/bin/sh
2#
3# /etc/init.d/xinetd -- script to start and stop xinetd.
4
5if test -f /etc/default/xinetd; then
6 . /etc/default/xinetd
7fi
8
9
10test -x /usr/sbin/xinetd || exit 0
11
12checkportmap () {
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
24case "$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 --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 --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 --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 ;;
55esac
56
57exit 0