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"
39 rm -f /var/lock/subsys/nscd >/dev/null 2>&1
42 msg_not_running "Name Switch Cache Daemon"
47 if [ -f /var/lock/subsys/nscd ]; then
51 msg_not_running "Name Switch Cache Daemon"
57 # See how we were called.
76 if [ -f /var/lock/subsys/nscd ]; then
77 for db in passwd group hosts; do
78 show "Invalidating %s cache" $db; busy
79 nscd -i $db && ok || fail
82 msg_not_running "Name Switch Cache Daemon"
90 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"