X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=debian%2Fxinetd.init;h=6fc0db6e80ea9e1d58188f351e61e3de3b3963c5;hb=d20b1d60cc64c371865a761b9a8b659ee6e43959;hp=b7fc550c25deafe1b7f28a7a89d825c8e41cc651;hpb=bfe146fec476f0bbe6e7d3f7ac452a808e7a24e8;p=packages%2Fxinetd.git diff --git a/debian/xinetd.init b/debian/xinetd.init index b7fc550..6fc0db6 100644 --- a/debian/xinetd.init +++ b/debian/xinetd.init @@ -1,60 +1,67 @@ #!/bin/sh -# -# /etc/init.d/xinetd -- script to start and stop xinetd. +### BEGIN INIT INFO +# Provides: inetd +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Should-Start: $syslog +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start or stop the xinetd daemon. +### END INIT INFO # clear poisonned environment unset TMPDIR -if test -f /etc/default/xinetd; then - . /etc/default/xinetd -fi +NAME=xinetd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +test -x "$DAEMON" || exit 0 -test -x /usr/sbin/xinetd || exit 0 +test -e /etc/default/$NAME && . /etc/default/$NAME +case "$INETD_COMPAT" in [Yy]*) XINETD_OPTS="$XINETD_OPTS -inetd_compat -inetd_ipv6";; esac + +. /lib/lsb/init-functions 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 + 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 - 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 "." - ;; + log_daemon_msg "Starting internet superserver" "$NAME" + start-stop-daemon --start --quiet --background --exec "$DAEMON" -- \ + -pidfile "$PIDFILE" $XINETD_OPTS + log_end_msg $? + ;; stop) - echo -n "Stopping internet superserver: xinetd" - start-stop-daemon --stop --signal 3 --quiet --oknodo --exec /usr/sbin/xinetd - echo "." - ;; + log_daemon_msg "Stopping internet superserver" "$NAME" + start-stop-daemon --stop --signal 3 --quiet --oknodo --exec "$DAEMON" + log_end_msg $? + ;; reload) - echo -n "Reloading internet superserver configuration: xinetd" - start-stop-daemon --stop --signal 1 --quiet --oknodo --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 --oknodo --exec /usr/sbin/xinetd - echo "." - ;; - restart) - $0 stop - $0 start - ;; + log_daemon_msg "Reloading internet superserver configuration" "$NAME" + start-stop-daemon --stop --signal 1 --quiet --oknodo --exec "$DAEMON" + log_end_msg $? + ;; + restart|force-reload) + $0 stop + $0 start + ;; *) - echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}" - exit 1 - ;; + echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}" + exit 1 + ;; esac exit 0