SOURCES: ldap.init - use functions - force-reload is not supposed ...
qboosh
qboosh at pld-linux.org
Fri Jan 4 22:58:26 CET 2008
Author: qboosh Date: Fri Jan 4 21:58:26 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- use functions
- force-reload is not supposed to start service if not running
- added try-restart action (LSB 3.1)
---- Files affected:
SOURCES:
ldap.init (1.28 -> 1.29)
---- Diffs:
================================================================
Index: SOURCES/ldap.init
diff -u SOURCES/ldap.init:1.28 SOURCES/ldap.init:1.29
--- SOURCES/ldap.init:1.28 Wed Oct 31 20:55:02 2007
+++ SOURCES/ldap.init Fri Jan 4 22:58:21 2008
@@ -34,11 +34,7 @@
exit 0
fi
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
- # Check if the service is already running?
+start() {
if [ ! -f /var/lock/subsys/ldap ]; then
msg_starting "OpenLDAP"
ARGS="-u slapd -g slapd"
@@ -62,8 +58,9 @@
else
msg_already_running "OpenLDAP"
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/ldap ]; then
msg_stopping "OpenLDAP"
killproc --waitforname slapd --waitfortime 300 slapd -TERM
@@ -71,18 +68,43 @@
else
msg_not_running "OpenLDAP"
fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/ldap ]; then
+ stop
+ start
+ else
+ msg_not_running "OpenLDAP"
+ RETVAL=$1
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
;;
status)
status slapd
RETVAL=$?
;;
- restart|force-reload)
- $0 stop
- $0 start
- exit $?
- ;;
*)
- msg_usage "$0 {start|stop|restart|force-reload|status}"
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
exit 3
esac
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/ldap.init?r1=1.28&r2=1.29&f=u
More information about the pld-cvs-commit
mailing list