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
41 [ -d /var
/db
/nscd
] || mkdir
/var
/db
/nscd
43 # for table in passwd group hosts
45 # if egrep -q '^'$table':.*nisplus' /etc/nsswitch.conf; then
46 # /usr/lib/nscd_nischeck $table || secure="$secure -S $table,yes"
49 echo -n $
"Starting $prog: "
50 daemon
/usr
/sbin
/nscd
$secure
53 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/nscd
58 echo -n $
"Stopping $prog: "
61 if [ $RETVAL -eq 0 ]; then
62 rm -f /var
/lock
/subsys
/nscd
63 # nscd won't be able to remove these if it is running as
64 # a non-privileged user
65 rm -f /var
/run
/nscd
/nscd.pid
66 rm -f /var
/run
/nscd
/socket
67 success $
"$prog shutdown"
69 failure $
"$prog shutdown"
80 # See how we were called.
99 [ -e /var
/lock
/subsys
/nscd
] && restart
103 killproc
/usr
/sbin
/nscd
-HUP
107 echo $
"Usage: $0 {start|stop|status|restart|reload|condrestart}"