diff options
Diffstat (limited to 'meta/recipes-extended/xinetd/xinetd/xinetd.init')
-rw-r--r-- | meta/recipes-extended/xinetd/xinetd/xinetd.init | 57 |
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 @@ +#!/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 |