09a3f6
#!/bin/sh
09a3f6
#
09a3f6
# chkconfig: - 12 88 
09a3f6
# description: Provides naming services using a directory server.
09a3f6
# processname: /usr/sbin/nslcd
09a3f6
# config: /etc/nslcd.conf
09a3f6
# pidfile: /var/run/nslcd/nslcd.pid
09a3f6
#
09a3f6
09a3f6
### BEGIN INIT INFO
09a3f6
# Provides: nslcd
09a3f6
# Required-Start: $network
09a3f6
# Required-Stop:
09a3f6
# Default-Start:
09a3f6
# Default-Stop:
09a3f6
# Short-Description: naming services LDAP client daemon
09a3f6
# Description: Provides naming services using a directory server.
09a3f6
### END INIT INFO
09a3f6
09a3f6
program=/usr/sbin/nslcd
09a3f6
prog=${program##*/}
09a3f6
pidfile=/var/run/nslcd/nslcd.pid
09a3f6
09a3f6
if [ -f /etc/rc.d/init.d/functions ]; then
09a3f6
	. /etc/rc.d/init.d/functions
09a3f6
fi
09a3f6
09a3f6
RETVAL=0
09a3f6
09a3f6
start() {
09a3f6
    echo -n $"Starting $prog: "
09a3f6
    daemon $program
09a3f6
    RETVAL=$?
09a3f6
    echo
09a3f6
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
09a3f6
    return $RETVAL
09a3f6
}
09a3f6
09a3f6
stop() {
09a3f6
    echo -n $"Stopping $prog: "
09a3f6
    killproc $program
09a3f6
    RETVAL=$?
09a3f6
    echo
09a3f6
    if [ $RETVAL -eq 0 ]; then
09a3f6
	rm -f /var/lock/subsys/$prog
09a3f6
    fi
09a3f6
}
09a3f6
09a3f6
restart() {
09a3f6
    stop
09a3f6
    start
09a3f6
}
09a3f6
09a3f6
# See how we were called.
09a3f6
case "$1" in
09a3f6
    start)
09a3f6
        [ -f /var/lock/subsys/$prog ] && exit 0
09a3f6
        $1
09a3f6
        ;;
09a3f6
    stop)
09a3f6
        [ -f /var/lock/subsys/$prog ] || exit 0
09a3f6
        $1
09a3f6
        ;;
09a3f6
    restart)
09a3f6
        $1
09a3f6
        ;;
09a3f6
    status)
09a3f6
        status -p $pidfile $program
09a3f6
        RETVAL=$?
09a3f6
        ;;
09a3f6
    condrestart|try-restart)
09a3f6
        [ -f /var/lock/subsys/$prog ] && restart || :
09a3f6
        ;;
09a3f6
    reload)
09a3f6
        echo "can't reload configuration, you have to restart it"
09a3f6
        RETVAL=3
09a3f6
        ;;
09a3f6
    force-reload)
09a3f6
        restart
09a3f6
        ;;
09a3f6
    *)
09a3f6
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
09a3f6
        exit 1
09a3f6
        ;;
09a3f6
esac
09a3f6
exit $RETVAL