r2134 - in glibc-package/trunk/debian: . debhelper.in
Author: madcoder
Date: 2007-04-25 20:29:32 +0000 (Wed, 25 Apr 2007)
New Revision: 2134
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/debhelper.in/nscd.init
Log:
nscd initscript improvements.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2007-04-25 19:51:55 UTC (rev 2133)
+++ glibc-package/trunk/debian/changelog 2007-04-25 20:29:32 UTC (rev 2134)
@@ -16,8 +16,15 @@
* patches/hurd-i386/local-dl-dynamic-weak.diff: new patch (turn
_dl_dynamic_weak on by default for hurd-i386).
- -- Aurelien Jarno <aurel32@debian.org> Wed, 25 Apr 2007 00:31:16 +0200
+ [ Pierre Habouzit ]
+ * nscd.init:
+ + use nscd --shutdown rather than start-stop-daemon to stop nscd more
+ gracefuly. Closes: #338507.
+ + also invalidate hosts on reload.
+ + drop oldies (nscd_nischeck things, does not exists anymore).
+ -- Pierre Habouzit <madcoder@debian.org> Wed, 25 Apr 2007 22:27:06 +0200
+
glibc (2.5-4) unstable; urgency=low
* debian/rules.d/build.mk: fix the testsuite workaround on the MIPS SB1
Modified: glibc-package/trunk/debian/debhelper.in/nscd.init
===================================================================
--- glibc-package/trunk/debian/debhelper.in/nscd.init 2007-04-25 19:51:55 UTC (rev 2133)
+++ glibc-package/trunk/debian/debhelper.in/nscd.init 2007-04-25 20:29:32 UTC (rev 2134)
@@ -35,17 +35,8 @@
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- 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
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 1
- start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" -- \
- $SECURE || return 2
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" || return 2
}
stop()
@@ -54,12 +45,19 @@
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
- start-stop-daemon --stop --quiet --retry=TERM/5/HUP/30/KILL/5 --pidfile "$PIDFILE" --name "$NAME"
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
+
+ # we try to stop using nscd --shutdown, that fails also if nscd is not present.
+ # in that case, fallback to "good old methods"
+ RETVAL=0
+ if ! $DAEMON --shutdown; then
+ start-stop-daemon --stop --quiet --pidfile "$PIDFILE" --name "$NAME" --test > /dev/null
+ RETVAL="$?"
+ [ "$?" -ne 0 -a "$?" -ne 1 ] && return 2
+ fi
+
# Wait for children to finish too
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
- [ "$?" = 2 ] && return 2
+ [ "$?" -ne 0 -a "$?" -ne 1 ] && return 2
rm -f "$PIDFILE"
return "$RETVAL"
}
@@ -95,7 +93,7 @@
restart|force-reload|reload)
echo -n "Restarting $DESC: $NAME"
stop
- $DAEMON --invalidate passwd --invalidate group
+ $DAEMON --invalidate passwd --invalidate group --invalidate hosts
case "$?" in
0|1)
start
Reply to: