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