[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#312404: nscd: want status option for init script



Package: nscd
Version: 2.3.2.ds1-22
Tags: patch

The following patch provides a "status" option for the /etc/init.d/ncsd
script.  It also fixes the exit status if the script is given an
unsupported option.

 < Stephen


--- glibc-2.3.2.ds1/debian/debhelper.in/nscd.init	2005-02-08 12:35:08.000000000 -0800
+++ debian/debhelper.in/nscd.init	2005-06-02 14:24:29.000000000 -0700
@@ -56,8 +56,19 @@
     restart)
 	$0 force-reload
 	;;
+    status)
+	echo -n "Status of $(basename $0) service: "
+	if pidof /usr/sbin/nscd > /dev/null ; then
+	    echo "running."
+	    RETVAL=0
+	else
+	    echo "not running."
+	    RETVAL=3
+	fi
+	;;
     *)
-	echo "Usage: /etc/init.d/nscd {start|stop|reload|force-reload|restart}"
+	echo "Usage: /etc/init.d/nscd {start|stop|reload|force-reload|restart|status}"
+	RETVAL=1
 	;;
 esac
 exit $RETVAL



Reply to: