source: trunk/server/common/patches/rc.nslcd.patch @ 1219

Last change on this file since 1219 was 949, checked in by quentin, 14 years ago
Whoops, add the patch that nss-ldapd applies when building to the repo
File size: 2.0 KB
  • new file rc.nslcd

    - +  
     1#!/bin/sh
     2#
     3# nslcd
     4#
     5# chkconfig: - 30 74
     6# description: nss-ldapd connection daemon
     7# processname: nslcd
     8# config:      /etc/nss-ldapd.conf
     9# pidfile:     /var/run/nslcd/nslcd.pid
     10
     11# http://fedoraproject.org/wiki/FCNewInit/Initscripts
     12### BEGIN INIT INFO
     13# Provides: nslcd
     14# Required-Start:
     15# Required-Stop:
     16# Should-Start:
     17# Should-Stop:
     18# Default-Start: 3 4 5
     19# Default-Stop: 0 1 2 6
     20# Short-Description: NSS-LDAP
     21# Description: NSS LDAP client daemon
     22### END INIT INFO
     23
     24# Source function library.
     25. /etc/rc.d/init.d/functions
     26
     27exec="/usr/sbin/nslcd"
     28prog=$(basename $exec)
     29
     30[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
     31
     32lockfile=/var/lock/subsys/$prog
     33
     34start() {
     35    echo -n $"Starting $prog: "
     36    # if not running, start it up here, usually something like "daemon $exec"
     37    daemon "$exec"
     38    retval=$?
     39    echo `/sbin/pidof -o %PPID "$prog"` > /var/run/named/"$prog".pid
     40    [ $retval -eq 0 ] && touch $lockfile
     41    return $retval
     42}
     43
     44stop() {
     45    echo -n $"Stopping $prog: "
     46    # stop it here, often "killproc $prog"
     47    killproc "$prog"
     48    retval=$?
     49    echo
     50    [ $retval -eq 0 ] && rm -f $lockfile
     51    return $retval
     52}
     53
     54restart() {
     55    stop
     56    start
     57}
     58
     59case "$1" in
     60    start|stop|restart)
     61        $1
     62        ;;
     63    force-reload)
     64        restart
     65        ;;
     66    status)
     67        status $prog
     68        ;;
     69    try-restart|condrestart)
     70        if status $prog >/dev/null ; then
     71            restart
     72        fi
     73        ;;
     74    reload)
     75        status $prog >/dev/null || exit 7
     76        # If config can be reloaded without restarting, implement it here,
     77        # remove the "exit", and add "reload" to the usage message below.
     78        action $"Service $prog does not support the reload action: " /bin/false
     79        exit 3
     80        ;;
     81    *)
     82        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
     83        exit 2
     84esac
Note: See TracBrowser for help on using the repository browser.