r1581 - in glibc-package: branches/glibc-2.4/debian branches/glibc-2.4/debian/debhelper.in branches/glibc-2.4/debian/local/etc_init.d trunk/debian trunk/debian/debhelper.in trunk/debian/local/etc_init.d
Author: aurel32
Date: 2006-05-30 00:13:28 +0000 (Tue, 30 May 2006)
New Revision: 1581
Removed:
glibc-package/branches/glibc-2.4/debian/local/etc_init.d/nscd
glibc-package/trunk/debian/local/etc_init.d/nscd
Modified:
glibc-package/branches/glibc-2.4/debian/changelog
glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/debhelper.in/nscd.init
Log:
* Merge debian/local/etc_init.d/nscd and debian/debhelper.in/nscd.init.
(Closes: #368587)
* Remove debian/local/etc_init.d/nscd.
Modified: glibc-package/branches/glibc-2.4/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.4/debian/changelog 2006-05-29 23:24:11 UTC (rev 1580)
+++ glibc-package/branches/glibc-2.4/debian/changelog 2006-05-30 00:13:28 UTC (rev 1581)
@@ -147,6 +147,9 @@
(/usr)/lib/i486-linux-gnu.
* Remove patches/i386/local-sse-oldkernel.diff (we don't support 2.2 kernels
anymore).
+ * Merge debian/local/etc_init.d/nscd and debian/debhelper.in/nscd.init.
+ (Closes: #368587)
+ * Remove debian/local/etc_init.d/nscd.
[ Denis Barbier ]
* Add patches/all/submitted-new-brf-encoding.diff: Add new BRF encoding
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-29 23:24:11 UTC (rev 1580)
+++ glibc-package/branches/glibc-2.4/debian/debhelper.in/nscd.init 2006-05-30 00:13:28 UTC (rev 1581)
@@ -1,125 +1,117 @@
#!/bin/sh
#
-# nscd: Starts the Name Switch Cache Daemon
+# nscd: Starts the Name Service Cache Daemon
#
-# 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
+# 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+
# Sanity checks.
-[ -f /etc/nscd.conf ] || exit 0
-[ -x /usr/sbin/nscd ] || exit 0
-# 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.[2-9].*)
- # this is okay
- ;;
- [3-9]*)
- # these are of course also okay
- ;;
- *)
- #this is not
- exit 1
- ;;
-esac
-RETVAL=0
-prog=nscd
+NAME="nscd"
+DESC="Name Service Cache Daemon"
+DAEMON="/usr/sbin/nscd"
+PIDFILE="/var/run/nscd/nscd.pid"
-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
+# Sanity checks.
+[ -f /etc/nscd.conf ] || exit 0
+[ -x "$DAEMON" ] || exit 0
+
+start()
+{
+ # Return
+ # 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
}
-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
+stop()
+{
+ # Return
+ # 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
+ # Wait for children to finish too
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
+ [ "$?" = 2 ] && return 2
+ rm -f "$PIDFILE"
+ return "$RETVAL"
}
-restart() {
- stop
- start
+status()
+{
+ # Return
+ # 0 if daemon is stopped
+ # 1 if daemon is running
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 1
+ return 0
}
-# See how we were called.
case "$1" in
- start)
+start)
+ echo -n "Starting $DESC: $NAME"
start
- RETVAL=$?
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (already running)." ; exit 0 ;;
+ *) echo " (failed)." ; exit 1 ;;
+ esac
;;
- stop)
+stop)
+ echo -n "Stopping $DESC: $NAME"
stop
- RETVAL=$?
- ;;
- reload)
- echo "Reloading Name Service Cache Daemon configuration... "
- start-stop-daemon --stop --signal 1 --quiet --oknodo --exec /usr/sbin/nscd
- RETVAL=$?
- echo "done."
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (not running)." ; exit 0 ;;
+ *) echo " (failed)." ; exit 1 ;;
+ esac
;;
- force-reload)
- $0 stop
- $0 start
- ;;
- restart)
- $0 force-reload
+restart|force-reload|reload)
+ echo -n "Restarting $DESC: $NAME"
+ stop
+ $DAEMON --invalidate
+ case "$?" in
+ 0|1)
+ start
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (failed -- old process is still running)." ; exit 1 ;;
+ *) echo " (failed to start)." ; exit 1 ;;
+ esac
+ ;;
+ *)
+ echo " (failed to stop)."
+ exit 1
+ ;;
+ esac
;;
- 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
+status)
+ echo -n "Status of $DESC service: "
+ status
+ case "$?" in
+ 0) echo "not running." ; exit 1 ;;
+ 1) echo "running." ; exit 0 ;;
+ esac
;;
- *)
- echo "Usage: /etc/init.d/nscd {start|stop|reload|force-reload|restart|status}"
- RETVAL=1
+*)
+ echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" >&2
+ exit 1
;;
esac
-exit $RETVAL
+
Deleted: glibc-package/branches/glibc-2.4/debian/local/etc_init.d/nscd
===================================================================
--- glibc-package/branches/glibc-2.4/debian/local/etc_init.d/nscd 2006-05-29 23:24:11 UTC (rev 1580)
+++ glibc-package/branches/glibc-2.4/debian/local/etc_init.d/nscd 2006-05-30 00:13:28 UTC (rev 1581)
@@ -1,114 +0,0 @@
-#!/bin/sh
-#
-### BEGIN INIT INFO
-# Provides: nscd
-# Required-Start: $syslog
-# Required-Stop: $syslog
-# Should-Start: $network slapd $named
-# Should-Stop: $network slapd $named
-# Default-Start: 2 3 4 5
-# Default-Stop: S 0 1 6
-### END INIT INFO
-#
-# nscd: Starts the Name Service 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+
-
-NAME="nscd"
-DESC="name service cache"
-DAEMON="/usr/sbin/nscd"
-PIDFILE="/var/run/nscd.pid"
-
-[ -x "$DAEMON" ] || exit 0
-
-# Set PATH?
-
-[ -s "/etc/nscd.conf" ] || exit 0
-
-# nscd does not run on any kernel lower than 2.2.0 because of threading problems
-case "$(uname -r)" in
- 2.[0-1].*|1.*) exit 0 ;;
-esac
-
-start()
-{
- # Return
- # 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
-}
-
-stop()
-{
- # Return
- # 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
- # Wait for children to finish too
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
- [ "$?" = 2 ] && return 2
- rm -f "$PIDFILE"
- return "$RETVAL"
-}
-
-case "$1" in
-start)
- echo -n "Starting $DESC: $NAME"
- start
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (already running)." ; exit 0 ;;
- *) echo " (failed)." ; exit 1 ;;
- esac
- ;;
-stop)
- echo -n "Stopping $DESC: $NAME"
- stop
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (not running)." ; exit 0 ;;
- *) echo " (failed)." ; exit 1 ;;
- esac
- ;;
-restart|force-reload|reload)
- echo -n "Restarting $DESC: $NAME"
- stop
- $DAEMON --invalidate
- case "$?" in
- 0|1)
- start
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (failed -- old process is still running)." ; exit 1 ;;
- *) echo " (failed to start)." ; exit 1 ;;
- esac
- ;;
- *)
- echo " (failed to stop)."
- exit 1
- ;;
- esac
- ;;
-*)
- echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
- exit 3
- ;;
-esac
-
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2006-05-29 23:24:11 UTC (rev 1580)
+++ glibc-package/trunk/debian/changelog 2006-05-30 00:13:28 UTC (rev 1581)
@@ -35,6 +35,9 @@
(/usr)/lib/i486-linux-gnu.
* Remove patches/i386/local-sse-oldkernel.diff (we don't support 2.2 kernels
anymore).
+ * Merge debian/local/etc_init.d/nscd and debian/debhelper.in/nscd.init.
+ (Closes: #368587)
+ * Remove debian/local/etc_init.d/nscd.
[ Denis Barbier ]
* Add patches/all/submitted-new-brf-encoding.diff: Add new BRF encoding
Modified: glibc-package/trunk/debian/debhelper.in/nscd.init
===================================================================
--- glibc-package/trunk/debian/debhelper.in/nscd.init 2006-05-29 23:24:11 UTC (rev 1580)
+++ glibc-package/trunk/debian/debhelper.in/nscd.init 2006-05-30 00:13:28 UTC (rev 1581)
@@ -8,67 +8,110 @@
# slow Services like NIS or NIS+
# Sanity checks.
+
+
+NAME="nscd"
+DESC="Name Service Cache Daemon"
+DAEMON="/usr/sbin/nscd"
+PIDFILE="/var/run/nscd/nscd.pid"
+
+# Sanity checks.
[ -f /etc/nscd.conf ] || exit 0
-[ -x /usr/sbin/nscd ] || exit 0
+[ -x "$DAEMON" ] || exit 0
-# 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
- ;;
-esac
-
-RETVAL=0
-case "$1" in
- start)
- secure=""
- for table in passwd group
+start()
+{
+ # Return
+ # 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
+ if egrep '^'$TABLE':.*nisplus' /etc/nsswitch.conf >/dev/null
then
- /usr/sbin/nscd_nischeck $table ||
- secure="$secure -S $table,yes"
+ /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
- RETVAL=$?
- echo "."
+ 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
+}
+
+stop()
+{
+ # Return
+ # 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
+ # Wait for children to finish too
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
+ [ "$?" = 2 ] && return 2
+ rm -f "$PIDFILE"
+ return "$RETVAL"
+}
+
+status()
+{
+ # Return
+ # 0 if daemon is stopped
+ # 1 if daemon is running
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 1
+ return 0
+}
+
+case "$1" in
+start)
+ echo -n "Starting $DESC: $NAME"
+ start
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (already running)." ; exit 0 ;;
+ *) echo " (failed)." ; exit 1 ;;
+ esac
;;
- stop)
- echo -n "Stopping Name Service Cache Daemon: nscd"
- /usr/sbin/nscd -K
- RETVAL=$?
- echo "."
- ;;
- reload)
- echo "Reloading Name Service Cache Daemon configuration... "
- start-stop-daemon --stop --signal 1 --quiet --oknodo --exec /usr/sbin/nscd
- RETVAL=$?
- echo "done."
+stop)
+ echo -n "Stopping $DESC: $NAME"
+ stop
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (not running)." ; exit 0 ;;
+ *) echo " (failed)." ; exit 1 ;;
+ esac
;;
- force-reload)
- $0 stop
- $0 start
- ;;
- restart)
- $0 force-reload
+restart|force-reload|reload)
+ echo -n "Restarting $DESC: $NAME"
+ stop
+ $DAEMON --invalidate
+ case "$?" in
+ 0|1)
+ start
+ case "$?" in
+ 0) echo "." ; exit 0 ;;
+ 1) echo " (failed -- old process is still running)." ; exit 1 ;;
+ *) echo " (failed to start)." ; exit 1 ;;
+ esac
+ ;;
+ *)
+ echo " (failed to stop)."
+ exit 1
+ ;;
+ esac
;;
- 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
+status)
+ echo -n "Status of $DESC service: "
+ status
+ case "$?" in
+ 0) echo "not running." ; exit 1 ;;
+ 1) echo "running." ; exit 0 ;;
+ esac
;;
- *)
- echo "Usage: /etc/init.d/nscd {start|stop|reload|force-reload|restart|status}"
- RETVAL=1
+*)
+ echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" >&2
+ exit 1
;;
esac
-exit $RETVAL
+
Deleted: glibc-package/trunk/debian/local/etc_init.d/nscd
===================================================================
--- glibc-package/trunk/debian/local/etc_init.d/nscd 2006-05-29 23:24:11 UTC (rev 1580)
+++ glibc-package/trunk/debian/local/etc_init.d/nscd 2006-05-30 00:13:28 UTC (rev 1581)
@@ -1,114 +0,0 @@
-#!/bin/sh
-#
-### BEGIN INIT INFO
-# Provides: nscd
-# Required-Start: $syslog
-# Required-Stop: $syslog
-# Should-Start: $network slapd $named
-# Should-Stop: $network slapd $named
-# Default-Start: 2 3 4 5
-# Default-Stop: S 0 1 6
-### END INIT INFO
-#
-# nscd: Starts the Name Service 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+
-
-NAME="nscd"
-DESC="name service cache"
-DAEMON="/usr/sbin/nscd"
-PIDFILE="/var/run/nscd.pid"
-
-[ -x "$DAEMON" ] || exit 0
-
-# Set PATH?
-
-[ -s "/etc/nscd.conf" ] || exit 0
-
-# nscd does not run on any kernel lower than 2.2.0 because of threading problems
-case "$(uname -r)" in
- 2.[0-1].*|1.*) exit 0 ;;
-esac
-
-start()
-{
- # Return
- # 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
-}
-
-stop()
-{
- # Return
- # 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
- # Wait for children to finish too
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
- [ "$?" = 2 ] && return 2
- rm -f "$PIDFILE"
- return "$RETVAL"
-}
-
-case "$1" in
-start)
- echo -n "Starting $DESC: $NAME"
- start
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (already running)." ; exit 0 ;;
- *) echo " (failed)." ; exit 1 ;;
- esac
- ;;
-stop)
- echo -n "Stopping $DESC: $NAME"
- stop
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (not running)." ; exit 0 ;;
- *) echo " (failed)." ; exit 1 ;;
- esac
- ;;
-restart|force-reload|reload)
- echo -n "Restarting $DESC: $NAME"
- stop
- $DAEMON --invalidate
- case "$?" in
- 0|1)
- start
- case "$?" in
- 0) echo "." ; exit 0 ;;
- 1) echo " (failed -- old process is still running)." ; exit 1 ;;
- *) echo " (failed to start)." ; exit 1 ;;
- esac
- ;;
- *)
- echo " (failed to stop)."
- exit 1
- ;;
- esac
- ;;
-*)
- echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
- exit 3
- ;;
-esac
-
Reply to: