Remade for experimental-2.0.92
[glibc/history.git] / nscd / nscd.init
blob097ce42c990220a6c7bd43a3dcb04c1106cc439a
1 #!/bin/sh
3 # nscd: Starts the Name Switch Cache Daemon
5 # chkconfig: 345 52 25
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 # Source function library.
12 . /etc/rc.d/init.d/functions
14 # See how we were called.
15 case "$1" in
16 start)
17 test -f /etc/nscd.conf -a -f /usr/sbin/nscd || exit 0
18 secure=""
19 # for table in passwd group
20 # do
21 # if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
22 # then
23 # /usr/lib/nscd_nischeck $table ||
24 # secure="$secure -S $table,yes"
25 # fi
26 # done
27 echo -n "Starting Name Switch Cache Daemon: "
28 daemon nscd $secure
29 echo
30 touch /var/lock/subsys/nscd
32 stop)
33 test -f /usr/sbin/nscd || exit 0
34 echo -n "Stopping Name Switch Cache Daemon: "
35 /usr/sbin/nscd -K
36 rm -f /var/lock/subsys/nscd
37 echo nscd
39 status)
40 status nscd
42 restart)
43 $0 stop
44 $0 start
47 echo "Usage: /etc/rc.d/init.d/nscd.init {start|stop|status|restart}"
49 esac
50 exit 0