tags 34092 + patch retitle 34092 inetd: should not be started when all services are commented out thanks
Making sure inetd didn't start when no services are configured would make this package more useful on a thin client where memory resources are sparse. We can not remove inetd on the thin client, as netbase depend on it (bug #87240). We need netbase to get /etc/init.d/networking and /etc/services, but do not want to start the daemon to avoid spending resources on it. This patch, based on the content of openbsd-inetd, will solve this problem, by making sure the daemon do not start unless there is services listed in inetd.conf. Please include this patch to make the package usable on thin clients as well. :) --- /etc/init.d/inetd 2001-11-18 23:29:19.000000000 +0100 +++ /tmp/inetd 2005-08-19 19:08:23.000000000 +0200 @@ -6,6 +6,13 @@ exit 0 fi +checknoservices () { + if ! grep -q "^[0-9A-Za-z/]" /etc/inetd.conf; then + echo " no services enabled, inetd not started." + exit 0 + fi +} + checkportmap () { if grep -v "^ *#" /etc/inetd.conf | grep 'rpc/' >/dev/null; then if ! [ -x /usr/bin/rpcinfo ] @@ -29,6 +36,7 @@ case "$1" in start) checkportmap + checknoservices echo -n "Starting internet superserver:" echo -n " inetd" ; start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd echo "." @@ -52,6 +60,7 @@ echo -n " inetd" start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid checkportmap + checknoservices start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd echo "." ;; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]