]>
Commit | Line | Data |
---|---|---|
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 | if [ ! -f /var/lock/subsys/nscd ]; then | |
28 | msg_starting "Name Switch Cache Daemon" | |
29 | daemon nscd | |
30 | RETVAL=$? | |
31 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd | |
32 | else | |
33 | msg_Already_Running "Name Switch Cache Daemon" | |
34 | exit 1 | |
35 | fi | |
36 | touch /var/lock/subsys/nscd | |
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 "Name Switch Cache Daemon" | |
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 |