]> git.pld-linux.org Git - packages/glibc.git/blob - nscd.init
- added dirs for dz,km,mg messages
[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 RETVAL=0
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         fi
36         ;;
37   stop)
38         if [ -f /var/lock/subsys/nscd ]; then
39                 msg_stopping "Name Switch Cache Daemon"
40                 busy
41                 /usr/sbin/nscd -K
42                 rm -f /var/lock/subsys/nscd >/dev/null 2>&1
43                 ok
44         else
45                 msg_not_running "Name Switch Cache Daemon"
46         fi
47         ;;
48   status)
49         status nscd
50         exit $?
51         ;;
52   restart|force-reload)
53         $0 stop
54         $0 start
55         exit $?
56         ;;
57   *)
58         msg_usage "$0 {start|stop|restart|force-reload|status}"
59         exit 3
60 esac
61
62 exit $RETVAL
This page took 0.099631 seconds and 3 git commands to generate.