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

r1564 - in glibc-package/branches/glibc-2.4/debian: . debhelper.in



Author: schizo
Date: 2006-05-28 20:33:13 +0000 (Sun, 28 May 2006)
New Revision: 1564

Modified:
   glibc-package/branches/glibc-2.4/debian/changelog
   glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init
Log:
    - debian/debhelper.in/nscd.init: partially sync nscd initscript
      with upstream.


Modified: glibc-package/branches/glibc-2.4/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.4/debian/changelog	2006-05-28 20:01:58 UTC (rev 1563)
+++ glibc-package/branches/glibc-2.4/debian/changelog	2006-05-28 20:33:13 UTC (rev 1564)
@@ -34,6 +34,8 @@
     - Build with gcc 4.1 on all architectures.
     - debian/patches/sparc/local-linuxthreads.diff: fill in missing
       preprocessor macros.
+    - debian/debhelper.in/nscd.init: partially sync nscd initscript
+      with upstream.
 
   [ Denis Barbier ]
     - Remove locale/complex-collate.diff (merged upstream).

Modified: glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init
===================================================================
--- glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init	2006-05-28 20:01:58 UTC (rev 1563)
+++ glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init	2006-05-28 20:33:13 UTC (rev 1564)
@@ -1,11 +1,25 @@
 #!/bin/sh
 #
-# nscd:		Starts the Name Service Cache Daemon
+# nscd:		Starts the Name Switch Cache Daemon
 #
-# description:  This is a daemon which handles passwd and group lookups
-#		for running programs and caches the results for the next
-#		query.  You should start this daemon only if you use
-#		slow Services like NIS or NIS+
+# chkconfig: - 30 74
+# description:  This is a daemon which handles passwd and group lookups \
+#		for running programs and cache the results for the next \
+#		query.  You should start this daemon if you use \
+#		slow naming services like NIS, NIS+, LDAP, or hesiod.
+# processname: /usr/sbin/nscd
+# config: /etc/nscd.conf
+#
+### BEGIN INIT INFO
+# Provides: nscd
+# Required-Start: $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Starts the Name Switch Cache Daemon
+# Description:  This is a daemon which handles passwd and group lookups \
+#		for running programs and cache the results for the next \
+#		query.  You should start this daemon if you use \
+#		slow naming services like NIS, NIS+, LDAP, or hesiod.
+### END INIT INFO
 
 # Sanity checks.
 [ -f /etc/nscd.conf ] || exit 0
@@ -13,35 +27,72 @@
 
 # nscd does not run on any kernel lower than 2.2.0 because of threading
 # problems, so we require that in first place.
-case `uname -r` in
-    2.[0-1].*|1.*)
-	# This is not ok
-	exit 0
-    ;;
+case $(uname -r) in
+    2.[2-9].*)
+	# this is okay
+	;;
+    [3-9]*)
+	# these are of course also okay
+	;;
+    *)
+	#this is not
+	exit 1
+	;;
 esac
 
 RETVAL=0
+prog=nscd
+
+start () {
+    [ -d /var/run/nscd ] || mkdir /var/run/nscd
+    [ -d /var/db/nscd ] || mkdir /var/db/nscd
+    secure=""
+#   for table in passwd group hosts
+#   do
+#   	if egrep -q '^'$table':.*nisplus' /etc/nsswitch.conf; then
+#   	    /usr/lib/nscd_nischeck $table || secure="$secure -S $table,yes"
+#   	fi
+#   done
+    echo -n "Starting $prog: "
+    start-stop-daemon --start --quiet --exec /usr/sbin/nscd -- $secure
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && touch /var/lock/nscd
+    return $RETVAL
+}
+
+stop () {
+    echo -n "Stopping $prog: "
+    /usr/sbin/nscd -K
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ]; then
+       	rm -f /var/lock/nscd
+	# nscd won't be able to remove these if it is running as
+	# a non-privileged user
+	rm -f /var/run/nscd/nscd.pid
+	rm -f /var/run/nscd/socket
+       	echo "$prog shutdown"
+    else
+       	echo "$prog shutdown"
+    fi
+    echo
+    return $RETVAL
+}
+
+restart() {
+    stop
+    start
+}
+
+# See how we were called.
 case "$1" in
     start)
-	secure=""
-	for table in passwd group
-	do
-#		if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
-#		then
-#			/usr/sbin/nscd_nischeck $table ||
-#				secure="$secure -S $table,yes"
-#		fi
-	done
-        echo -n "Starting Name Service Cache Daemon: nscd"
-	start-stop-daemon --start --quiet --exec /usr/sbin/nscd -- $secure
+	start
 	RETVAL=$?
-	echo "."
 	;;
     stop)
-	echo -n "Stopping Name Service Cache Daemon: nscd"
-	/usr/sbin/nscd -K
+	stop
 	RETVAL=$?
-	echo "."
         ;;
     reload)
 	echo "Reloading Name Service Cache Daemon configuration... "



Reply to: