Blob Blame History Raw
diff -up lcdproc-0.5.2/scripts/init-LCDd.LSB.in.initscripts lcdproc-0.5.2/scripts/init-LCDd.LSB.in
--- lcdproc-0.5.2/scripts/init-LCDd.LSB.in.initscripts	2007-04-14 16:41:20.000000000 +0200
+++ lcdproc-0.5.2/scripts/init-LCDd.LSB.in	2009-05-13 17:14:25.000000000 +0200
@@ -1,10 +1,18 @@
 #! /bin/sh
+#
+# chkconfig: - 70 21
+# description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
+#	Apart from the main client lcdproc(1) there are various clients. \
+#	See http://lcdproc.omnipotent.net for details.
+# processname: LCDd
+#
+# config: /etc/sysconfig/lcdproc/LCDd.conf
 
-#### BEGIN INIT INFO
+### BEGIN INIT INFO
 # Provides:          LCDd
 # Required-Start:    $syslog $local_fs $network $remote_fs
 # Required-Stop:     $syslog $local_fs $network $remote_fs
-# Default-Start:     2 3 4 5
+# Default-Start:     
 # Default-Stop:      S 0 1 6
 # Short-Description: LCDproc Server Daemon
 # Description:       LSB init script for LCDd, the display
@@ -12,57 +20,92 @@
 ### END INIT INFO
 
 
-# local variables
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-etc=@sysconfdir@
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME=LCDd
-DAEMON=${sbindir}/$NAME
-DESC="LCDproc display server daemon"
-DEFAULTS=/etc/default/$NAME
-START=yes
-
-# Source defaults file; edit that file to configure this script.
-if [ -e "${DEFAULTS}" ]; then
-  . "${DEFAULTS}"
+prog=LCDd
+lockfile=/var/lock/subsys/$prog
+configfile=@sysconfdir@/$prog.conf
+RETVAL=0
+
+
+# load LSB 3.x init functions
+if [ -e /lib/lsb/init-functions ]; then
+  . /lib/lsb/init-functions
 fi
 
-# If we're not to start the daemon, simply exit
-if [ "${START}" != "yes" ]; then
-    exit 0
+# Source function library.
+if [ -e /etc/rc.d/init.d/functions ]; then
+  . /etc/rc.d/init.d/functions
 fi
 
-# installation check
-test -x $DAEMON || exit 5
+# check that non-default config file exists.
+ [ -f $configfile ] || exit 6
 
-# load LSB 3.x init functions
-. /lib/lsb/init-functions
+
+start() {
+	echo -n $"Starting $prog services: "
+	daemon $prog -c $configfile
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch $lockfile || \
+	   RETVAL=1
+	return $RETVAL
+}	
+
+stop() {
+	echo -n $"Shutting down $prog services: "
+	killproc $prog
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f $lockfile
+	return $RETVAL
+}	
+
+reload() {
+        echo -n $"Reloading $prog file: "
+	killproc $prog -HUP
+	RETVAL=$?
+	echo
+	return $RETVAL
+}	
+
+rhstatus() {
+	status $prog
+	return $?
+}	
+
+
+# Allow status as non-root.
+if [ "$1" = status ]; then
+       rhstatus
+       exit $?
+fi
 
 
 case "$1" in
   start)
-	log_daemon_msg "Starting $DESC" "$NAME"
-	start_daemon $DAEMON $OPTIONS
-	log_end_msg $?
+	start
 	;;
   stop)
-	log_daemon_msg "Stopping $DESC" "$NAME"
-	killproc $DAEMON
-	log_end_msg $?
-	;;
-  restart|reload|force-reload)
-	$0 stop
-	sleep 1
-	$0 start
+	stop
+	;;
+  status)
+	status $prog
+	;;
+  restart|force-reload)
+	stop
+	start
+	;;
+  try-restart|condrestart)
+	if [ -f $lockfile ]; then
+	    stop
+	    start
+	fi
+	;;
+  reload)
+	reload
 	;;
   *)
-	echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+	echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
 	exit 2
-	;;
 esac
 
-exit 0
+exit $RETVAL
diff -up lcdproc-0.5.2/scripts/init-lcdproc.LSB.in.initscripts lcdproc-0.5.2/scripts/init-lcdproc.LSB.in
--- lcdproc-0.5.2/scripts/init-lcdproc.LSB.in.initscripts	2007-04-14 16:41:20.000000000 +0200
+++ lcdproc-0.5.2/scripts/init-lcdproc.LSB.in	2009-05-13 10:37:32.000000000 +0200
@@ -1,10 +1,19 @@
 #! /bin/sh
+#
+# chkconfig: - 71 20
+# description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
+#	Apart from the main client lcdproc(1) there are various clients. \
+#	See http://lcdproc.omnipotent.net for details.
+# processname: lcdproc
+#
+# config: /etc/sysconfig/lcdproc/lcdproc.conf
 
-#### BEGIN INIT INFO
+### BEGIN INIT INFO
 # Provides:          lcdproc
 # Required-Start:    $syslog $local_fs $network $remote_fs
 # Required-Stop:     $syslog $local_fs $network $remote_fs
-# Default-Start:     2 3 4 5
+# Should-Start:      LCDd
+# Default-Start:     
 # Default-Stop:      S 0 1 6
 # Short-Description: LCDproc system status information viewer
 # Description:       LSB init script for lcdproc, the system
@@ -12,57 +21,91 @@
 ### END INIT INFO
 
 
-# local variables
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-etc=@sysconfdir@
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME=lcdproc
-DAEMON=${bindir}/$NAME
-DESC="LCDproc system status monitor"
-DEFAULTS=/etc/default/$NAME
-START=yes
-
-# Source defaults file; edit that file to configure this script.
-if [ -e "${DEFAULTS}" ]; then
-  . "${DEFAULTS}"
+prog=lcdproc
+lockfile=/var/lock/subsys/$prog
+configfile=@sysconfdir@/$prog.conf
+RETVAL=0
+
+# load LSB 3.x init functions
+if [ -e /lib/lsb/init-functions ]; then
+  . /lib/lsb/init-functions
 fi
 
-# If we're not to start the daemon, simply exit
-if [ "${START}" != "yes" ]; then
-    exit 0
+# Source function library.
+if [ -e /etc/rc.d/init.d/functions ]; then
+  . /etc/rc.d/init.d/functions
 fi
 
-# installation check
-test -x $DAEMON || exit 5
+# check that non-default config file exists.
+ [ -f $configfile ] || exit 6
 
-# load LSB 3.x init functions
-. /lib/lsb/init-functions
+
+start() {
+	echo -n $"Starting $prog services: "
+	daemon $prog -c $configfile
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch $lockfile || \
+	   RETVAL=1
+	return $RETVAL
+}	
+
+stop() {
+	echo -n $"Shutting down $prog services: "
+	killproc $prog
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f $lockfile
+	return $RETVAL
+}	
+
+reload() {
+        echo -n $"Reloading $prog file: "
+	killproc $prog -HUP
+	RETVAL=$?
+	echo
+	return $RETVAL
+}	
+
+rhstatus() {
+	status $prog
+	return $?
+}	
+
+
+# Allow status as non-root.
+if [ "$1" = status ]; then
+       rhstatus
+       exit $?
+fi
 
 
 case "$1" in
   start)
-	log_daemon_msg "Starting $DESC" "$NAME"
-	start_daemon $DAEMON $OPTIONS
-	log_end_msg $?
+	start
 	;;
   stop)
-	log_daemon_msg "Stopping $DESC" "$NAME"
-	killproc $DAEMON
-	log_end_msg $?
-	;;
-  restart|reload|force-reload)
-	$0 stop
-	sleep 1
-	$0 start
+	stop
+	;;
+  status)
+	status $prog
+	;;
+  restart|force-reload)
+	stop
+	start
+	;;
+  try-restart|condrestart)
+	if [ -f $lockfile ]; then
+	    stop
+	    start
+	fi
+	;;
+  reload)
+	reload
 	;;
   *)
-	echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+	echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
 	exit 2
-	;;
 esac
 
-exit 0
+exit $RETVAL