]> git.pld-linux.org Git - packages/glibc.git/blob - nscd.init
updated
[packages/glibc.git] / nscd.init
1 #!/bin/sh
2 #
3 # nscd:         Starts the Name Switch Cache Daemon
4 #
5 # chkconfig:    345 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
12 #
13
14 # Sanity checks.
15 [ -f /etc/nscd.conf ] || exit 0
16 [ -x /usr/sbin/nscd ] || exit 0
17
18 # Source function library.
19 . /etc/rc.d/init.d/functions
20
21 # Get sysconfig
22 [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
23
24
25 # See how we were called.
26 case "$1" in
27   start)
28         if [ ! -f /var/lock/subsys/nscd ]; then
29                 msg_starting "Name Switch Cache Daemon"
30                 daemon nscd
31                 RETVAL=$?
32                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
33         else
34                 msg_already_running "Name Switch Cache Daemon"
35                 exit 1
36         fi
37         ;;
38   stop)
39         if [ -f /var/lock/subsys/nscd ]; then
40                 msg_stopping "Name Switch Cache Daemon"
41                 busy
42                 /usr/sbin/nscd -K
43                 rm -f /var/lock/subsys/nscd >/dev/null 2>&1
44                 ok
45         else
46                 msg_not_running "Name Switch Cache Daemon"
47                 exit 1
48         fi      
49         ;;
50   status)
51         status nscd
52         ;;
53   restart|reload)
54         $0 stop
55         $0 start
56         ;;
57   *)
58         msg_usage "$0 {start|stop|restart|reload|status}"
59         exit 1
60         ;;
61 esac
62
63 exit $RETVAL
This page took 0.037664 seconds and 4 git commands to generate.