Update.
[glibc.git] / nscd / nscd.init
blob572288a2bb1bfb2d1555e7010e01fbbb5bcbfc14
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 # nscd does not run on any kernel lower than 2.2.0 because of threading
22 # problems, so we require that in first place.
23 case $(uname -r) in
24 2.[2-9].*)
25 # this is okay
27 [3-9]*)
28 # these are of course also okay
31 #this is not
32 exit 0
34 esac
36 RETVAL=0
38 # See how we were called.
39 case "$1" in
40 start)
41 secure=""
42 # for table in passwd group
43 # do
44 # if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
45 # then
46 # /usr/lib/nscd_nischeck $table ||
47 # secure="$secure -S $table,yes"
48 # fi
49 # done
50 echo -n "Starting Name Switch Cache Daemon: "
51 daemon nscd $secure
52 RETVAL=$?
53 echo
54 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
56 stop)
57 echo -n "Stopping Name Switch Cache Daemon: "
58 /usr/sbin/nscd -K
59 RETVAL=$?
60 if [ $RETVAL -eq 0 ]; then
61 rm -f /var/lock/subsys/nscd
62 echo nscd
63 else
64 echo
67 status)
68 status nscd
69 RETVAL=$?
71 restart)
72 $0 stop
73 $0 start
74 RETVAL=$?
76 reload)
77 killproc -HUP nscd
78 RETVAL=$?
81 echo "Usage: $0 {start|stop|status|restart}"
83 esac
84 exit $RETVAL