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 if you use \
9 # slow naming services like NIS, NIS+, LDAP, or hesiod.
10 # processname: /usr/sbin/nscd
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
/init.d
/functions
21 # nscd does not run on any kernel lower than 2.2.0 because of threading
22 # problems, so we require that in first place.
28 # these are of course also okay
40 [ -d /var
/run
/nscd
] || mkdir
/var
/run
/nscd
42 # for table in passwd group hosts
44 # if egrep -q '^'$table':.*nisplus' /etc/nsswitch.conf; then
45 # /usr/lib/nscd_nischeck $table || secure="$secure -S $table,yes"
48 echo -n $
"Starting $prog: "
49 daemon
/usr
/sbin
/nscd
$secure
52 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/nscd
57 echo -n $
"Stopping $prog: "
60 if [ $RETVAL -eq 0 ]; then
61 rm -f /var
/lock
/subsys
/nscd
62 # nscd won't be able to remove these if it is running as
63 # a non-privileged user
64 rm -f /var
/run
/nscd
/nscd.pid
65 rm -f /var
/run
/nscd
/.socket
66 success $
"$prog shutdown"
68 failure $
"$prog shutdown"
79 # See how we were called.
98 [ -e /var
/lock
/subsys
/nscd
] && restart
102 killproc
/usr
/sbin
/nscd
-HUP
106 echo $
"Usage: $0 {start|stop|status|restart|reload|condrestart}"