955ae7b
Index: lcdproc-0.5.3/scripts/init-LCDd.rpm.in
955ae7b
===================================================================
955ae7b
--- lcdproc-0.5.3.orig/scripts/init-LCDd.rpm.in
955ae7b
+++ lcdproc-0.5.3/scripts/init-LCDd.rpm.in
955ae7b
@@ -1,5 +1,5 @@
955ae7b
 #!/bin/sh
955ae7b
-# This is the LCDd init-script for RPM based (RedHat, Mandrake) systems
955ae7b
+# This is the LCDd init-script for RPM based (Red Hat, Mandrake) systems
955ae7b
 #
955ae7b
 # Copyright (C) 2001  Rene Wagner <reenoo@gmx.de>
955ae7b
 #               2001  Guillaume Filion <gfk@logidac.com>
955ae7b
@@ -19,25 +19,53 @@
955ae7b
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
955ae7b
 #
955ae7b
 #
955ae7b
-# chkconfig: 345 70 21
955ae7b
+# chkconfig: - 70 21
955ae7b
 # description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
955ae7b
 #	Apart from the main client lcdproc(1) there are various clients. \
955ae7b
 #	See http://lcdproc.omnipotent.net for details.
955ae7b
 # processname: LCDd
955ae7b
 # pidfile: /var/run/LCDd.pid
955ae7b
 # config: @sysconfdir@/LCDd.conf
955ae7b
+#
955ae7b
+### BEGIN INIT INFO
955ae7b
+# Provides:          LCDd
955ae7b
+# Required-Start:    $syslog $local_fs $network $remote_fs
955ae7b
+# Required-Stop:     $syslog $local_fs $network $remote_fs
955ae7b
+# Should-Start:      udev
955ae7b
+# Default-Start:
955ae7b
+# Default-Stop:      S 0 1 6
955ae7b
+# Short-Description: LCDproc Server Daemon
955ae7b
+# Description:       init script for LCDd, the display
955ae7b
+#                    server daemon in the LCDproc suite
955ae7b
+### END INIT INFO
955ae7b
+
955ae7b
+prog=LCDd
955ae7b
+lockfile=/var/lock/subsys/$prog
955ae7b
+configfile=@sysconfdir@/$prog.conf
955ae7b
+
955ae7b
+# load LSB 3.x init functions
955ae7b
+if [ -e /lib/lsb/init-functions ]; then
955ae7b
+  . /lib/lsb/init-functions
955ae7b
+fi
955ae7b
 
955ae7b
 # Source function library.
955ae7b
-. /etc/rc.d/init.d/functions
955ae7b
+if [ -e /etc/rc.d/init.d/functions ]; then
955ae7b
+  . /etc/rc.d/init.d/functions
955ae7b
+fi
955ae7b
 
955ae7b
 # Source networking configuration.
955ae7b
-. /etc/sysconfig/network
955ae7b
+if [ -e /etc/sysconfig/network ]; then
955ae7b
+  . /etc/sysconfig/network
955ae7b
+fi
955ae7b
 
955ae7b
 # Check that networking is up.
955ae7b
 if [ ${NETWORKING} = "no" ]; then
955ae7b
         exit 0
955ae7b
 fi
955ae7b
 
955ae7b
+# check that non-default config file exists.
955ae7b
+[ -f $configfile ] || exit 6
955ae7b
+
955ae7b
 RETVAL=0
955ae7b
 
955ae7b
 prefix=@prefix@
955ae7b
@@ -46,41 +74,49 @@ bindir=@bindir@
955ae7b
 sbindir=@sbindir@
955ae7b
 etc=@sysconfdir@
955ae7b
 
955ae7b
-LCDd=${sbindir}/LCDd
955ae7b
-configfile=${etc}/LCDd.conf
955ae7b
-
955ae7b
-[ -x ${LCDd} ] || exit 0
c30e8aa
+[ -x ${sbindir}/${prog} ] || exit 0
955ae7b
 
955ae7b
 start() {
955ae7b
-	echo -n "Starting up LCDd: "
955ae7b
-	daemon ${LCDd} -c ${configfile}
955ae7b
-
955ae7b
+	echo -n "Starting ${prog} service: "
955ae7b
+	daemon ${prog} -c ${configfile}
955ae7b
 	RETVAL=$?
955ae7b
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/LCDd
955ae7b
 	echo
955ae7b
+	[ $RETVAL -eq 0 ] && touch ${lockfile} || \
955ae7b
+	   RETVAL=1
955ae7b
+	return $RETVAL
955ae7b
 }
955ae7b
 
955ae7b
 stop() {
955ae7b
-	echo -n "Shutting down LCDd: "
955ae7b
-	killproc LCDd
955ae7b
+	echo -n "Shutting down ${prog} service: "
955ae7b
+	killproc ${prog}
955ae7b
 	RETVAL=$?
955ae7b
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/LCDd
955ae7b
 	echo
955ae7b
+	[ $RETVAL -eq 0 ] && rm -f ${lockfile}
955ae7b
+	return $RETVAL
955ae7b
 }
955ae7b
 
955ae7b
-dostatus() {
955ae7b
-	status LCDd
955ae7b
+reload() {
955ae7b
+	echo -n $"Reloading ${prog} conig file: "
955ae7b
+	killproc ${prog} -HUP
955ae7b
 	RETVAL=$?
955ae7b
+	echo
955ae7b
+	return $RETVAL
955ae7b
+}
955ae7b
+
955ae7b
+dostatus() {
955ae7b
+	status ${prog}
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 restart() {
955ae7b
 	stop
955ae7b
 	start
955ae7b
-	RETVAL=$?
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 condrestart() {
955ae7b
-	[ -e /var/lock/subsys/LCDd ] && restart || :
955ae7b
+	[ -f ${lockfile} ] && restart || :
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 # See how we were called.
955ae7b
@@ -94,15 +130,18 @@ case "$1" in
955ae7b
   status)
955ae7b
 	dostatus
955ae7b
 	;;
955ae7b
-  restart)
955ae7b
+  restart|force-reload)
955ae7b
 	restart
955ae7b
 	;;
955ae7b
-  condrestart)
955ae7b
+  try-restart|condrestart)
955ae7b
 	condrestart
955ae7b
 	;;
955ae7b
+  reload)
955ae7b
+	reload
955ae7b
+	;;
955ae7b
   *)
955ae7b
-	echo "Usage: $0 {start|stop|status|restart|condrestart}"
955ae7b
-	exit 1
955ae7b
+	echo "Usage: $0 {start|stop|status|restart|condrestart|reload}"
955ae7b
+	exit 2
955ae7b
 esac
955ae7b
 
955ae7b
 exit $RETVAL
955ae7b
Index: lcdproc-0.5.3/scripts/init-lcdproc.rpm.in
955ae7b
===================================================================
955ae7b
--- lcdproc-0.5.3.orig/scripts/init-lcdproc.rpm.in
955ae7b
+++ lcdproc-0.5.3/scripts/init-lcdproc.rpm.in
955ae7b
@@ -19,68 +19,104 @@
955ae7b
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
955ae7b
 #
955ae7b
 #
955ae7b
-# chkconfig: 345 71 20
955ae7b
+# chkconfig: - 71 20
955ae7b
 # description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \
955ae7b
 #	Apart from the main client lcdproc(1) there are various clients. \
955ae7b
 #	See http://lcdproc.omnipotent.net for details.
955ae7b
 # processname: lcdproc
955ae7b
 # pidfile: /var/run/lcdproc.pid
955ae7b
-# config: /etc/sysconfig/lcdproc
955ae7b
+# config: @sysconfdir@/lcdproc.conf
955ae7b
+#
955ae7b
+### BEGIN INIT INFO
955ae7b
+# Provides:          lcdproc
955ae7b
+# Required-Start:    $syslog $local_fs $network $remote_fs
955ae7b
+# Required-Stop:     $syslog $local_fs $network $remote_fs
955ae7b
+# Should-Start:      LCDd
955ae7b
+# Default-Start:
955ae7b
+# Default-Stop:      S 0 1 6
955ae7b
+# Short-Description: LCDproc system status information viewer
955ae7b
+# Description:       LSB init script for lcdproc, the system
955ae7b
+#                    status information viewer in the LCDproc suite
955ae7b
+### END INIT INFO
955ae7b
+
955ae7b
+prog=lcdproc
955ae7b
+lockfile=/var/lock/subsys/$prog
955ae7b
+configfile=@sysconfdir@/$prog.conf
955ae7b
+RETVAL=0
955ae7b
+
955ae7b
+# load LSB 3.x init functions
955ae7b
+if [ -e /lib/lsb/init-functions ]; then
955ae7b
+  . /lib/lsb/init-functions
955ae7b
+fi
955ae7b
 
955ae7b
 # Source function library.
955ae7b
-. /etc/rc.d/init.d/functions
955ae7b
+if [ -e /etc/rc.d/init.d/functions ]; then
955ae7b
+  . /etc/rc.d/init.d/functions
955ae7b
+fi
955ae7b
 
955ae7b
 # Source networking configuration.
955ae7b
-. /etc/sysconfig/network
955ae7b
+if [ -e /etc/sysconfig/network ]; then
955ae7b
+  . /etc/sysconfig/network
955ae7b
+fi
955ae7b
 
955ae7b
 # Check that networking is up.
955ae7b
 if [ ${NETWORKING} = "no" ]; then
955ae7b
         exit 0
955ae7b
 fi
955ae7b
 
955ae7b
-RETVAL=0
955ae7b
-
955ae7b
 prefix=@prefix@
955ae7b
 exec_prefix=@exec_prefix@
955ae7b
 bindir=@bindir@
955ae7b
 sbindir=@sbindir@
955ae7b
 etc=@sysconfdir@
955ae7b
 
955ae7b
-lcdproc=${bindir}/lcdproc
955ae7b
+[ -x ${bindir}/${prog} ] || exit 0
955ae7b
 
955ae7b
-[ -x ${lcdproc} ] || exit 0
955ae7b
+# check that non-default config file exists.
955ae7b
+ [ -f $configfile ] || exit 6
955ae7b
 
955ae7b
 
955ae7b
 start() {
955ae7b
-	echo -n "Starting up lcdproc: "
955ae7b
-	daemon ${lcdproc} $SCREENS
955ae7b
-
955ae7b
+	echo -n "Starting ${prog} service: "
955ae7b
+	daemon ${prog} -c ${configfile}
955ae7b
 	RETVAL=$?
955ae7b
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/lcdproc
955ae7b
 	echo
955ae7b
+	[ $RETVAL -eq 0 ] && touch ${lockfile} || \
955ae7b
+	   RETVAL=1
955ae7b
+	return $RETVAL
955ae7b
 }
955ae7b
 
955ae7b
 stop() {
955ae7b
-	echo -n "Shutting down lcdproc: "
955ae7b
-	killproc lcdproc
955ae7b
+	echo -n "Shutting down ${prog} service: "
955ae7b
+	killproc ${prog}
955ae7b
 	RETVAL=$?
955ae7b
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lcdproc
955ae7b
 	echo
955ae7b
+	[ $RETVAL -eq 0 ] && rm -f ${lockfile}
955ae7b
+	return $RETVAL
955ae7b
 }
955ae7b
 
955ae7b
-dostatus() {
955ae7b
-	status lcdproc
955ae7b
+reload() {
955ae7b
+	echo -n $"Reloading ${prog} config file: "
955ae7b
+	killproc ${prog} -HUP
955ae7b
 	RETVAL=$?
955ae7b
+	echo
955ae7b
+	return $RETVAL
955ae7b
+}
955ae7b
+
955ae7b
+dostatus() {
955ae7b
+	status ${prog}
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 restart() {
955ae7b
 	stop
955ae7b
 	start
955ae7b
-	RETVAL=$?
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 condrestart() {
955ae7b
-	[ -e /var/lock/subsys/lcdproc ] && restart || :
955ae7b
+	[ -f ${lockfile} ] && restart || :
955ae7b
+	return $?
955ae7b
 }
955ae7b
 
955ae7b
 # See how we were called.
955ae7b
@@ -94,14 +130,17 @@ case "$1" in
955ae7b
   status)
955ae7b
 	dostatus
955ae7b
 	;;
955ae7b
-  restart)
955ae7b
+  restart|force-reload)
955ae7b
 	restart
955ae7b
 	;;
955ae7b
-  condrestart)
955ae7b
+  try-restart|condrestart)
955ae7b
 	condrestart
955ae7b
 	;;
955ae7b
+  reload)
955ae7b
+	reload
955ae7b
+	;;
955ae7b
   *)
955ae7b
-	echo "Usage: $0 {start|stop|status|restart|condrestart}"
955ae7b
+	echo "Usage: $0 {start|stop|status|restart|condrestart|reload}"
955ae7b
 	exit 1
955ae7b
 esac
955ae7b