wok-next view nscd/stuff/nscd @ rev 13915
Add xpaint (thanks mojo)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 25 10:03:15 2013 +0100 (2013-01-25) |
parents | |
children | 7f188676b59c |
line source
1 #!/bin/sh
2 # /etc/init.d/nscd : Start, stop and restart nscd server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start nscd server at boot time, just put nscd in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=nscd
12 DESC="Name Switch Cache Daemon"
13 DAEMON=/usr/sbin/nscd
14 OPTIONS=$NSCD_OPTIONS
15 PIDFILE=/var/run/nscd/nscd.pid
17 [ -d /var/run/nscd ] || mkdir /var/run/nscd
18 [ -d /var/db/nscd ] || mkdir /var/db/nscd
20 case "$1" in
21 start)
22 if active_pidfile $PIDFILE nscd ; then
23 echo "$NAME already running."
24 exit 1
25 fi
26 echo -n "Starting $DESC: $NAME... "
27 $DAEMON $OPTIONS
28 status
29 sleep 2
30 ;;
31 stop)
32 if ! active_pidfile $PIDFILE nscd ; then
33 echo "$NAME is not running."
34 exit 1
35 fi
36 echo -n "Stopping $DESC: $NAME... "
37 kill `cat $PIDFILE`
38 status
39 sleep 2
40 ;;
41 restart)
42 if ! active_pidfile $PIDFILE nscd ; then
43 echo "$NAME is not running."
44 exit 1
45 fi
46 echo -n "Restarting $DESC: $NAME... "
47 kill `cat $PIDFILE`
48 sleep 2
49 $DAEMON $OPTIONS
50 status
51 sleep 2
52 ;;
53 *)
54 echo ""
55 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart
56 ]"
57 echo ""
58 exit 1
59 ;;
60 esac
62 exit 0