]>
Commit | Line | Data |
---|---|---|
9fb0fa33 | 1 | #!/bin/sh |
da301058 | 2 | # |
3 | # nscd: Starts the Name Switch Cache Daemon | |
4 | # | |
d0f1f4fa | 5 | # chkconfig: 345 30 80 |
6 | # description: This is a daemon which handles passwd and group lookups \ | |
da301058 | 7 | # for running programs and cache the results for the next \ |
d0f1f4fa | 8 | # query. You should start this daemon only if you use \ |
da301058 | 9 | # slow Services like NIS or NIS+ |
d0f1f4fa | 10 | # processname: nscd |
11 | # config: /etc/nscd.conf | |
da301058 | 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 | ||
02156a25 | 21 | # Get sysconfig |
d0f1f4fa | 22 | [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd |
02156a25 | 23 | |
da301058 | 24 | # See how we were called. |
25 | case "$1" in | |
26 | start) | |
d0f1f4fa | 27 | if [ ! -f /var/lock/subsys/nscd ]; then |
bec6c405 | 28 | msg_starting "Name Switch Cache Daemon" |
d0f1f4fa | 29 | daemon nscd |
30 | RETVAL=$? | |
31 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd | |
32 | else | |
bec6c405 | 33 | msg_Already_Running "Name Switch Cache Daemon" |
d0f1f4fa | 34 | exit 1 |
35 | fi | |
bec6c405 | 36 | touch /var/lock/subsys/nscd |
d0f1f4fa | 37 | ;; |
da301058 | 38 | stop) |
d0f1f4fa | 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 | |
bec6c405 | 47 | msg_Not_Running "Name Switch Cache Daemon" |
d0f1f4fa | 48 | exit 1 |
49 | fi | |
da301058 | 50 | ;; |
51 | status) | |
52 | status nscd | |
53 | ;; | |
54 | restart|reload) | |
55 | $0 stop | |
56 | $0 start | |
57 | ;; | |
58 | *) | |
9e368645 | 59 | msg_Usage "$0 {start|stop|status|restart|reload}" |
d0f1f4fa | 60 | exit 1 |
da301058 | 61 | ;; |
62 | esac | |
d0f1f4fa | 63 | |
64 | exit $RETVAL |