diff options
author | Guillem Jover <guillem@debian.org> | 2008-02-19 03:23:31 +0000 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2010-06-10 23:21:22 +0200 |
commit | 73686ffee16e14ebcd6aa9d8dcd51b042d0db10e (patch) | |
tree | 85995bcd5f4e6b95788b29535b5fbb6c9778d0ea | |
parent | 3f6407a6d3d1449d583eb319a775fb67dce47cba (diff) | |
download | inetutils-73686ffee16e14ebcd6aa9d8dcd51b042d0db10e.tar.gz |
Do not start inetd if there's no services enabled
Stolen from openbsd-inetd.
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/inetutils-inetd.init | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 3b70fa2..565b8fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ inetutils (2:1.5.dfsg.1-5) UNRELEASED; urgency=low * Switch Build-Depends from automake1.9 to automake. * Do not install a duplicated inetutils-syslogd in /etc/default/, just syslogd. (Closes: #435049) + * Do not start inetd if there's no services enabled (stolen from + openbsd-inetd). -- Guillem Jover <guillem@debian.org> Fri, 18 May 2007 07:37:19 +0300 diff --git a/debian/inetutils-inetd.init b/debian/inetutils-inetd.init index 3957e6c..9f3d8f9 100644 --- a/debian/inetutils-inetd.init +++ b/debian/inetutils-inetd.init @@ -21,8 +21,18 @@ set -e . /lib/lsb/init-functions +check_no_services() +{ + if ! grep -q "^[0-9A-Za-z/]" /etc/inetd.conf; then + log_warning_msg "Not starting internet superserver: no services enabled." + exit 0 + fi +} + + case "$1" in start) + check_no_services log_daemon_msg "Starting $DESC" "$NAME" start-stop-daemon --start --quiet --oknodo \ --pidfile /var/run/$NAME.pid --exec $DAEMON @@ -44,6 +54,7 @@ case "$1" in log_daemon_msg "Restarting $DESC" "$NAME" start-stop-daemon --stop --quiet --oknodo --pidfile \ /var/run/$NAME.pid --exec $DAEMON + check_no_services sleep 1 start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON |