wok-6.x view nscd/stuff/nscd @ rev 24192

updated perl-date-manip (6.81 -> 6.86)
author Hans-G?nter Theisgen
date Fri Dec 31 14:44:57 2021 +0100 (2021-12-31)
parents 2ae8ee18aa85
children
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-server caching 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 _ '%s is already running.' $NAME
24 exit 1
25 fi
26 action 'Starting %s: %s...' "$DESC" $NAME
27 $DAEMON $OPTIONS
28 status
29 sleep 2
30 ;;
31 stop)
32 if ! active_pidfile $PIDFILE nscd ; then
33 _ '%s is not running.' $NAME
34 exit 1
35 fi
36 action 'Stopping %s: %s...' "$DESC" $NAME
37 kill $(cat $PIDFILE)
38 status
39 sleep 2
40 ;;
41 restart)
42 if ! active_pidfile $PIDFILE nscd ; then
43 _ '%s is not running.' $NAME
44 exit 1
45 fi
46 action 'Restarting %s: %s...' "$DESC" $NAME
47 kill $(cat $PIDFILE)
48 sleep 2
49 $DAEMON $OPTIONS
50 status
51 sleep 2
52 ;;
53 *)
54 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
55 newline
56 exit 1
57 ;;
58 esac
60 exit 0