3 # nscd: Starts the Name Switch Cache Daemon
6 # description: This is a daemon which handles passwd and group lookups \
7 # for running programs and cache the results for the next \
8 # query. You should start this daemon only if you use \
9 # slow Services like NIS or NIS+
11 # config: /etc/nscd.conf
15 [ -f /etc/nscd.conf ] || exit 0
17 # Source function library.
18 . /etc/rc.d/init.d/functions
21 [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
24 if [ ! -f /var/lock/subsys/nscd ]; then
25 msg_starting "Name Switch Cache Daemon"
28 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
30 msg_already_running "Name Switch Cache Daemon"
35 if [ -f /var/lock/subsys/nscd ]; then
36 msg_stopping "Name Switch Cache Daemon"
37 killproc --pidfile /var/run/nscd/nscd.pid nscd -TERM
38 rm -f /var/lock/subsys/nscd >/dev/null 2>&1
40 msg_not_running "Name Switch Cache Daemon"
45 if [ -f /var/lock/subsys/nscd ]; then
49 msg_not_running "Name Switch Cache Daemon"
55 # See how we were called.
74 if [ -f /var/lock/subsys/nscd ]; then
75 for db in passwd group hosts; do
76 show "Invalidating %s cache" $db; busy
77 nscd -i $db && ok || fail
80 msg_not_running "Name Switch Cache Daemon"
88 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"