summaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-17 01:37:38 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-17 01:37:38 +0000
commitaa6adf822954e7c2b1b631f849598b1cab3450e5 (patch)
tree4a1237f12842750c751103d59101140bc876ded9 /nscd
parent23d914d96abe41e282a65329ee9e32e108b74d2c (diff)
Update.
* nscd/nscd.init: Test for kernel version and make LSB compliant. Patch by Christian Gafton.
Diffstat (limited to 'nscd')
-rw-r--r--nscd/nscd.init55
1 files changed, 42 insertions, 13 deletions
diff --git a/nscd/nscd.init b/nscd/nscd.init
index 6dc9d76b33..572288a2bb 100644
--- a/nscd/nscd.init
+++ b/nscd/nscd.init
@@ -7,7 +7,7 @@
# for running programs and cache the results for the next \
# query. You should start this daemon only if you use \
# slow Services like NIS or NIS+
-# processname: nscd
+# processname: nscd
# config: /etc/nscd.conf
#
@@ -18,38 +18,67 @@
# Source function library.
. /etc/rc.d/init.d/functions
+# 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 0
+ ;;
+esac
+
+RETVAL=0
+
# See how we were called.
case "$1" in
start)
secure=""
- for table in passwd group hosts
- do
- if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
- then
- /usr/sbin/nscd_nischeck $table ||
- secure="$secure -S $table,yes"
- fi
- done
+# for table in passwd group
+# do
+# if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
+# then
+# /usr/lib/nscd_nischeck $table ||
+# secure="$secure -S $table,yes"
+# fi
+# done
echo -n "Starting Name Switch Cache Daemon: "
daemon nscd $secure
+ RETVAL=$?
echo
- touch /var/lock/subsys/nscd
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
;;
stop)
echo -n "Stopping Name Switch Cache Daemon: "
/usr/sbin/nscd -K
- rm -f /var/lock/subsys/nscd
- echo nscd
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ rm -f /var/lock/subsys/nscd
+ echo nscd
+ else
+ echo
+ fi
;;
status)
status nscd
+ RETVAL=$?
;;
restart)
$0 stop
$0 start
+ RETVAL=$?
+ ;;
+ reload)
+ killproc -HUP nscd
+ RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
;;
esac
-exit 0
+exit $RETVAL