wok-backports diff nscd/stuff/nscd @ rev 19

Add glibc, nss
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 05 23:27:55 2014 +0100 (2014-01-05)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nscd/stuff/nscd	Sun Jan 05 23:27:55 2014 +0100
     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