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
16 [ -x /usr/sbin/nscd ] || exit 0
18 # Source function library.
19 . /etc/rc.d/init.d/functions
22 [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
25 if [ ! -f /var/lock/subsys/nscd ]; then
26 msg_starting "Name Switch Cache Daemon"
29 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
31 msg_already_running "Name Switch Cache Daemon"
36 if [ -f /var/lock/subsys/nscd ]; then
37 msg_stopping "Name Switch Cache Daemon"
40 rm -f /var/lock/subsys/nscd >/dev/null 2>&1
43 msg_not_running "Name Switch Cache Daemon"
48 # See how we were called.
61 if [ -f /var/lock/subsys/nscd ]; then
62 for db in passwd group hosts; do
63 show "Invalidating %s cache" $db; busy
64 nscd -i $db && ok || fail
67 msg_not_running "Name Switch Cache Daemon"
75 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"