Update.
[glibc.git] / nscd / nscd.init
blob63172a0d1abddb7514d60edb26a51c4108a5e635
1 #!/bin/sh
3 # nscd: Starts the Name Switch Cache Daemon
5 # chkconfig: - 30 80
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+
10 # processname: nscd
11 # config: /etc/nscd.conf
14 # Sanity checks.
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
21 # See how we were called.
22 case "$1" in
23 start)
24 secure=""
25 # for table in passwd group
26 # do
27 # if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
28 # then
29 # /usr/lib/nscd_nischeck $table ||
30 # secure="$secure -S $table,yes"
31 # fi
32 # done
33 echo -n "Starting Name Switch Cache Daemon: "
34 daemon nscd $secure
35 echo
36 touch /var/lock/subsys/nscd
38 stop)
39 echo -n "Stopping Name Switch Cache Daemon: "
40 /usr/sbin/nscd -K
41 rm -f /var/lock/subsys/nscd
42 echo nscd
44 status)
45 status nscd
47 restart)
48 $0 stop
49 $0 start
52 echo "Usage: $0 {start|stop|status|restart}"
54 esac
55 exit 0