]> git.pld-linux.org Git - packages/glibc.git/blob - nscd.init
- beter rc-scripts 0.2.0 compliance.
[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 # See how we were called.
25 case "$1" in
26     start)
27         touch /var/lock/subsys/nscd
28         if [ ! -f /var/lock/subsys/nscd ]; then
29                 msg_starting "nscd"
30                 daemon nscd
31                 RETVAL=$?
32                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
33         else
34                 msg_Already_Running "nscd"
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                 deltext
45                 ok
46         else
47                 msg_Not_Running "nscd"
48                 exit 1
49         fi      
50         ;;
51   status)
52         status nscd
53         ;;
54   restart|reload)
55         $0 stop
56         $0 start
57         ;;
58     *)
59         msg_Usage "$0 {start|stop|status|restart|reload}"
60         exit 1
61         ;;
62 esac
63
64 exit $RETVAL
This page took 0.077196 seconds and 4 git commands to generate.