wok diff nscd/stuff/nscd @ rev 13197
Up: fail2ban to 0.8.7.1.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Aug 05 11:03:51 2012 +0000 (2012-08-05) |
parents | |
children | 7f188676b59c |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nscd/stuff/nscd Sun Aug 05 11:03:51 2012 +0000 1.3 @@ -0,0 +1,62 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/nscd : Start, stop and restart nscd server on SliTaz, at 1.6 +# boot time or with the command line. 1.7 +# 1.8 +# To start nscd server at boot time, just put nscd in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 +. /etc/daemons.conf 1.13 + 1.14 +NAME=nscd 1.15 +DESC="Name Switch Cache Daemon" 1.16 +DAEMON=/usr/sbin/nscd 1.17 +OPTIONS=$NSCD_OPTIONS 1.18 +PIDFILE=/var/run/nscd/nscd.pid 1.19 + 1.20 +[ -d /var/run/nscd ] || mkdir /var/run/nscd 1.21 +[ -d /var/db/nscd ] || mkdir /var/db/nscd 1.22 + 1.23 +case "$1" in 1.24 + start) 1.25 + if active_pidfile $PIDFILE nscd ; then 1.26 + echo "$NAME already running." 1.27 + exit 1 1.28 + fi 1.29 + echo -n "Starting $DESC: $NAME... " 1.30 + $DAEMON $OPTIONS 1.31 + status 1.32 + sleep 2 1.33 + ;; 1.34 + stop) 1.35 + if ! active_pidfile $PIDFILE nscd ; then 1.36 + echo "$NAME is not running." 1.37 + exit 1 1.38 + fi 1.39 + echo -n "Stopping $DESC: $NAME... " 1.40 + kill `cat $PIDFILE` 1.41 + status 1.42 + sleep 2 1.43 + ;; 1.44 + restart) 1.45 + if ! active_pidfile $PIDFILE nscd ; then 1.46 + echo "$NAME is not running." 1.47 + exit 1 1.48 + fi 1.49 + echo -n "Restarting $DESC: $NAME... " 1.50 + kill `cat $PIDFILE` 1.51 + sleep 2 1.52 + $DAEMON $OPTIONS 1.53 + status 1.54 + sleep 2 1.55 + ;; 1.56 + *) 1.57 + echo "" 1.58 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart 1.59 +]" 1.60 + echo "" 1.61 + exit 1 1.62 + ;; 1.63 +esac 1.64 + 1.65 +exit 0