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