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 # Required-Start: $syslog
17 # Short-Description: Starts the Name Switch Cache Daemon
18 # Description: This is a daemon which handles passwd and group lookups \
19 # for running programs and cache the results for the next \
20 # query. You should start this daemon if you use \
21 # slow naming services like NIS, NIS+, LDAP, or hesiod.
25 [ -f /etc
/nscd.conf
] ||
exit 0
26 [ -x /usr
/sbin
/nscd
] ||
exit 0
28 # Source function library.
29 .
/etc
/init.d
/functions
31 # nscd does not run on any kernel lower than 2.2.0 because of threading
32 # problems, so we require that in first place.
38 # these are of course also okay
50 [ -d /var
/run
/nscd
] || mkdir
/var
/run
/nscd
51 [ -d /var
/db
/nscd
] || mkdir
/var
/db
/nscd
53 # for table in passwd group hosts
55 # if egrep -q '^'$table':.*nisplus' /etc/nsswitch.conf; then
56 # /usr/lib/nscd_nischeck $table || secure="$secure -S $table,yes"
59 echo -n $
"Starting $prog: "
60 daemon
/usr
/sbin
/nscd
$secure
63 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/nscd
68 echo -n $
"Stopping $prog: "
71 if [ $RETVAL -eq 0 ]; then
72 rm -f /var
/lock
/subsys
/nscd
73 # nscd won't be able to remove these if it is running as
74 # a non-privileged user
75 rm -f /var
/run
/nscd
/nscd.pid
76 rm -f /var
/run
/nscd
/socket
77 success $
"$prog shutdown"
79 failure $
"$prog shutdown"
90 # See how we were called.
108 try-restart | condrestart
)
109 [ -e /var
/lock
/subsys
/nscd
] && restart
112 force-reload | reload
)
113 echo -n $
"Reloading $prog: "
114 killproc
/usr
/sbin
/nscd
-HUP
119 echo $
"Usage: $0 {start|stop|status|restart|reload|condrestart}"