summaryrefslogtreecommitdiff
path: root/nscd/nscd.init
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd.init')
-rw-r--r--nscd/nscd.init34
1 files changed, 13 insertions, 21 deletions
diff --git a/nscd/nscd.init b/nscd/nscd.init
index a882da7d8b..cf2461b9c7 100644
--- a/nscd/nscd.init
+++ b/nscd/nscd.init
@@ -9,6 +9,7 @@
# slow naming services like NIS, NIS+, LDAP, or hesiod.
# processname: /usr/sbin/nscd
# config: /etc/nscd.conf
+# config: /etc/sysconfig/nscd
#
### BEGIN INIT INFO
# Provides: nscd
@@ -28,20 +29,8 @@
# Source function library.
. /etc/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 1
- ;;
-esac
+# Source an auxiliary options file if we have one, and pick up NSCD_OPTIONS.
+[ -r /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
RETVAL=0
prog=nscd
@@ -50,7 +39,7 @@ start () {
[ -d /var/run/nscd ] || mkdir /var/run/nscd
[ -d /var/db/nscd ] || mkdir /var/db/nscd
echo -n $"Starting $prog: "
- daemon /usr/sbin/nscd
+ daemon /usr/sbin/nscd $NSCD_OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
@@ -83,11 +72,11 @@ restart() {
# See how we were called.
case "$1" in
start)
- start
+ [ -e /var/lock/subsys/nscd ] || start
RETVAL=$?
;;
stop)
- stop
+ [ ! -e /var/lock/subsys/nscd ] || stop
RETVAL=$?
;;
status)
@@ -99,14 +88,17 @@ case "$1" in
RETVAL=$?
;;
try-restart | condrestart)
- [ -e /var/lock/subsys/nscd ] && restart
+ [ ! -e /var/lock/subsys/nscd ] || restart
RETVAL=$?
;;
force-reload | reload)
echo -n $"Reloading $prog: "
- killproc /usr/sbin/nscd -HUP
- RETVAL=$?
- echo
+ RETVAL=0
+ /usr/sbin/nscd -i passwd || RETVAL=$?
+ /usr/sbin/nscd -i group || RETVAL=$?
+ /usr/sbin/nscd -i hosts || RETVAL=$?
+ /usr/sbin/nscd -i services || RETVAL=$?
+ echo
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"