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