From 2a890565bcf354c006590e88facc826c79f10a5d Mon Sep 17 00:00:00 2001 From: marschap Date: Sat, 21 Oct 2006 20:01:42 +0000 Subject: [PATCH] update existing Debian init scripts; add new Debian & LSB init scripts --- configure.in | 8 +++- scripts/Makefile.am | 12 ++++- scripts/README | 28 ++++++++++++ scripts/debian/lcdproc.LCDd.init | 5 ++- scripts/debian/lcdproc.init | 5 ++- scripts/debian/lcdproc.lcdexec.init | 5 ++- scripts/debian/lcdproc.lcdvc.init | 5 ++- scripts/init-LCDd.LSB.in | 68 +++++++++++++++++++++++++++++ scripts/init-LCDd.debian.in | 36 +++++++-------- scripts/init-lcdexec.LSB.in | 68 +++++++++++++++++++++++++++++ scripts/init-lcdexec.debian.in | 51 ++++++++++++++++++++++ scripts/init-lcdproc.LSB.in | 68 +++++++++++++++++++++++++++++ scripts/init-lcdproc.debian.in | 36 +++++++-------- scripts/init-lcdvc.LSB.in | 68 +++++++++++++++++++++++++++++ scripts/init-lcdvc.debian.in | 51 ++++++++++++++++++++++ 15 files changed, 468 insertions(+), 46 deletions(-) create mode 100644 scripts/README create mode 100644 scripts/init-LCDd.LSB.in create mode 100644 scripts/init-lcdexec.LSB.in create mode 100644 scripts/init-lcdexec.debian.in create mode 100644 scripts/init-lcdproc.LSB.in create mode 100644 scripts/init-lcdvc.LSB.in create mode 100644 scripts/init-lcdvc.debian.in diff --git a/configure.in b/configure.in index f8562bb..35a7b88 100644 --- a/configure.in +++ b/configure.in @@ -580,8 +580,14 @@ AC_CONFIG_FILES([Makefile docs/lcdproc-user/Makefile docs/lcdproc-user/drivers/Makefile scripts/Makefile + scripts/init-LCDd.LSB + scripts/init-lcdproc.LSB + scripts/init-lcdexec.LSB + scripts/init-lcdvc.LSB scripts/init-LCDd.debian - scripts/init-LCDd.rpm scripts/init-lcdproc.debian + scripts/init-lcdexec.debian + scripts/init-lcdvc.debian + scripts/init-LCDd.rpm scripts/init-lcdproc.rpm]) AC_OUTPUT diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1f2ebe2..61aeb19 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,6 +1,16 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = init-LCDd.debian.in init-LCDd.rpm.in init-lcdproc.debian.in init-lcdproc.rpm.in debian +EXTRA_DIST = README \ + init-LCDd.LSB.in \ + init-lcdproc.LSB.in \ + init-lcdexec.LSB.in \ + init-lcdvc.LSB.in \ + init-LCDd.debian.in \ + init-lcdproc.debian.in \ + init-lcdexec.debian.in \ + init-lcdvc.debian.in \ + init-LCDd.rpm.in \ + init-lcdproc.rpm.in debian dist-hook: rm -rf `find $(distdir)/debian -name CVS` diff --git a/scripts/README b/scripts/README new file mode 100644 index 0000000..750edec --- /dev/null +++ b/scripts/README @@ -0,0 +1,28 @@ +This directory contains +* init-script templates for various system types + (These templates are adapted to the confugration parameters + passed to configure at configure-run-time.) + + - init-*.LSB.in templates for systems conforming to LSB + (Linux Standard Base) 3.x. Among others + the following distributions support LSB 3.x: + - SuSE Linux 10.x + - SuSE Linux Enterprise Server 10 + - SuSE Linux Enterprise Server 9 SP3 + - Ubuntu 6.06 + - Debian Etch + - RedHat Enterprise Linux4 Update2 + + - init-*.debian.in templates for older Debian systems (or modern Debian + systems without the lsb-core package installed) + + - init-*.rpm init-scripts for RPM based distributions that are + not LSB 3.x conforming. + Please try the LSB scripts first. + +- a sub-directory debian/ that contains the infrastructure to create a + Debian package for lcdproc. + Simply copy the debian/ directory to the top-level source directory, + adapt the call in debian/rules to your wishes, call + dpkg -rfakeoot -sd + and you're done. diff --git a/scripts/debian/lcdproc.LCDd.init b/scripts/debian/lcdproc.LCDd.init index bd10714..d90cd72 100644 --- a/scripts/debian/lcdproc.LCDd.init +++ b/scripts/debian/lcdproc.LCDd.init @@ -14,10 +14,11 @@ # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/LCDd NAME=LCDd +DAEMON=/usr/sbin/$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 @@ -53,7 +54,7 @@ case "$1" in $0 start ;; *) - echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac diff --git a/scripts/debian/lcdproc.init b/scripts/debian/lcdproc.init index 4a788b7..f2c6f8d 100644 --- a/scripts/debian/lcdproc.init +++ b/scripts/debian/lcdproc.init @@ -14,10 +14,11 @@ # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/lcdproc NAME=lcdproc +DAEMON=/usr/bin/$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 @@ -53,7 +54,7 @@ case "$1" in $0 start ;; *) - echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac diff --git a/scripts/debian/lcdproc.lcdexec.init b/scripts/debian/lcdproc.lcdexec.init index 8f254ef..d710a0e 100644 --- a/scripts/debian/lcdproc.lcdexec.init +++ b/scripts/debian/lcdproc.lcdexec.init @@ -14,10 +14,11 @@ # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/lcdexec NAME=lcdexec +DAEMON=/usr/bin/$NAME DESC="LCDproc program starter" DEFAULTS=/etc/default/$NAME +START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then @@ -53,7 +54,7 @@ case "$1" in $0 start ;; *) - echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac diff --git a/scripts/debian/lcdproc.lcdvc.init b/scripts/debian/lcdproc.lcdvc.init index 51cd3a4..524adf1 100644 --- a/scripts/debian/lcdproc.lcdvc.init +++ b/scripts/debian/lcdproc.lcdvc.init @@ -14,10 +14,11 @@ # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/lcdvc NAME=lcdvc +DAEMON=/usr/bin/$NAME DESC="LCDproc virtual console" DEFAULTS=/etc/default/$NAME +START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then @@ -53,7 +54,7 @@ case "$1" in $0 start ;; *) - echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac diff --git a/scripts/init-LCDd.LSB.in b/scripts/init-LCDd.LSB.in new file mode 100644 index 0000000..52b8892 --- /dev/null +++ b/scripts/init-LCDd.LSB.in @@ -0,0 +1,68 @@ +#! /bin/sh + +#### 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-Stop: S 0 1 6 +# Short-Description: LCDproc Server Daemon +# Description: LSB init script for LCDd, the display +# server daemon in the LCDproc suite +### 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}" +fi + +# If we're not to start the daemon, simply exit +if [ "${START}" != "yes" ]; then + exit 0 +fi + +# installation check +test -x $DAEMON || exit 5 + +# load LSB 3.x init functions +. /lib/lsb/init-functions + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + start_daemon $DAEMON $OPTIONS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + killproc $DAEMON + log_end_msg $? + ;; + restart|reload|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 2 + ;; +esac + +exit 0 diff --git a/scripts/init-LCDd.debian.in b/scripts/init-LCDd.debian.in index 8e7900c..459ba66 100644 --- a/scripts/init-LCDd.debian.in +++ b/scripts/init-LCDd.debian.in @@ -11,6 +11,7 @@ # server daemon in the LCDproc suite ### END INIT INFO +# local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ @@ -19,33 +20,32 @@ etc=@sysconfdir@ NAME=LCDd DAEMON=${sbindir}/${NAME} -DESC="${NAME} @VERSION@" - +DESC="LCDproc display server daemon" OPTIONS="" - +# installation check test -x ${DAEMON} || exit 0 case "$1" in start) - printf "Starting ${DESC}: " - start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} - printf "${NAME}." - ;; + printf "Starting ${DESC}: " + start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} + printf "${NAME}." + ;; stop) - printf "Stopping ${DESC}: " - start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} - printf "${NAME}." - ;; + printf "Stopping ${DESC}: " + start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} + printf "${NAME}." + ;; restart|force-reload) - $0 stop - sleep 1 - $0 start - ;; + $0 stop + sleep 1 + $0 start + ;; *) - printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 - exit 1 - ;; + printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 + exit 1 + ;; esac exit 0 diff --git a/scripts/init-lcdexec.LSB.in b/scripts/init-lcdexec.LSB.in new file mode 100644 index 0000000..d0e45d9 --- /dev/null +++ b/scripts/init-lcdexec.LSB.in @@ -0,0 +1,68 @@ +#! /bin/sh + +#### BEGIN INIT INFO +# Provides: lcdexec +# Required-Start: $syslog $local_fs $network $remote_fs +# Required-Stop: $syslog $local_fs $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: LCDproc program starter from the LCDd menu +# Description: LSB init script for lcdexec, the client to +# start programs from the LCDd menu in the LCDproc suite +### 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=lcdexec +DAEMON=${bindir}/$NAME +DESC="LCDproc program starter" +DEFAULTS=/etc/default/$NAME +START=no + +# Source defaults file; edit that file to configure this script. +if [ -e "${DEFAULTS}" ]; then + . "${DEFAULTS}" +fi + +# If we're not to start the daemon, simply exit +if [ "${START}" != "yes" ]; then + exit 0 +fi + +# installation check +test -x $DAEMON || exit 5 + +# load LSB 3.x init functions +. /lib/lsb/init-functions + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + start_daemon $DAEMON $OPTIONS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + killproc $DAEMON + log_end_msg $? + ;; + restart|reload|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 2 + ;; +esac + +exit 0 diff --git a/scripts/init-lcdexec.debian.in b/scripts/init-lcdexec.debian.in new file mode 100644 index 0000000..ed41b69 --- /dev/null +++ b/scripts/init-lcdexec.debian.in @@ -0,0 +1,51 @@ +#!/bin/sh -e + +#### BEGIN INIT INFO +# Provides: lcdexec +# Required-Start: $syslog $local_fs $network $remote_fs +# Required-Stop: $syslog $local_fs $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: LCDproc program starter from the LCDd menu +# Description: Debian init script for lcdexec, the client to +# start programs from the LCDd menu in the LCDproc suite +### END INIT INFO + +# local variables +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +sbindir=@sbindir@ +etc=@sysconfdir@ + +NAME=lcdexec +DAEMON=${bindir}/${NAME} +DESC="LCDproc program starter" +OPTIONS="" + +# installation check +test -x ${DAEMON} || exit 0 + +case "$1" in + start) + printf "Starting ${DESC}: " + start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} + printf "${NAME}." + ;; + stop) + printf "Stopping ${DESC}: " + start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} + printf "${NAME}." + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/scripts/init-lcdproc.LSB.in b/scripts/init-lcdproc.LSB.in new file mode 100644 index 0000000..5ac990d --- /dev/null +++ b/scripts/init-lcdproc.LSB.in @@ -0,0 +1,68 @@ +#! /bin/sh + +#### 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 +# 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 + + +# 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}" +fi + +# If we're not to start the daemon, simply exit +if [ "${START}" != "yes" ]; then + exit 0 +fi + +# installation check +test -x $DAEMON || exit 5 + +# load LSB 3.x init functions +. /lib/lsb/init-functions + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + start_daemon $DAEMON $OPTIONS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + killproc $DAEMON + log_end_msg $? + ;; + restart|reload|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 2 + ;; +esac + +exit 0 diff --git a/scripts/init-lcdproc.debian.in b/scripts/init-lcdproc.debian.in index 53e4551..7d2938f 100644 --- a/scripts/init-lcdproc.debian.in +++ b/scripts/init-lcdproc.debian.in @@ -11,6 +11,7 @@ # status information viewer in the LCDproc suite ### END INIT INFO +# local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ @@ -19,33 +20,32 @@ etc=@sysconfdir@ NAME=lcdproc DAEMON=${bindir}/${NAME} -DESC="${NAME} @VERSION@" - +DESC="LCDproc system status monitor" OPTIONS="" - +# installation check test -x ${DAEMON} || exit 0 case "$1" in start) - printf "Starting ${DESC}: " - start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} - printf "${NAME}." - ;; + printf "Starting ${DESC}: " + start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} + printf "${NAME}." + ;; stop) - printf "Stopping ${DESC}: " - start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} - printf "${NAME}." - ;; + printf "Stopping ${DESC}: " + start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} + printf "${NAME}." + ;; restart|force-reload) - $0 stop - sleep 1 - $0 start - ;; + $0 stop + sleep 1 + $0 start + ;; *) - printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 - exit 1 - ;; + printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 + exit 1 + ;; esac exit 0 diff --git a/scripts/init-lcdvc.LSB.in b/scripts/init-lcdvc.LSB.in new file mode 100644 index 0000000..c36dddf --- /dev/null +++ b/scripts/init-lcdvc.LSB.in @@ -0,0 +1,68 @@ +#! /bin/sh + +#### BEGIN INIT INFO +# Provides: lcdvc +# Required-Start: $syslog $local_fs $network $remote_fs +# Required-Stop: $syslog $local_fs $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: LCDproc virtual console +# Description: LSB init script for lcdvc, the virtual +# console client in the LCDproc suite +### 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=lcdvc +DAEMON=${bindir}/$NAME +DESC="LCDproc virtual console" +DEFAULTS=/etc/default/$NAME +START=no + +# Source defaults file; edit that file to configure this script. +if [ -e "${DEFAULTS}" ]; then + . "${DEFAULTS}" +fi + +# If we're not to start the daemon, simply exit +if [ "${START}" != "yes" ]; then + exit 0 +fi + +# installation check +test -x $DAEMON || exit 5 + +# load LSB 3.x init functions +. /lib/lsb/init-functions + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + start_daemon $DAEMON $OPTIONS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + killproc $DAEMON + log_end_msg $? + ;; + restart|reload|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 2 + ;; +esac + +exit 0 diff --git a/scripts/init-lcdvc.debian.in b/scripts/init-lcdvc.debian.in new file mode 100644 index 0000000..11a1093 --- /dev/null +++ b/scripts/init-lcdvc.debian.in @@ -0,0 +1,51 @@ +#!/bin/sh -e + +#### BEGIN INIT INFO +# Provides: lcdvc +# Required-Start: $syslog $local_fs $network $remote_fs +# Required-Stop: $syslog $local_fs $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: LCDproc virtual console +# Description: Debian init script for lcdvc, the virtual +# console client in the LCDproc suite +### END INIT INFO + +# local variables +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +sbindir=@sbindir@ +etc=@sysconfdir@ + +NAME=lcdvc +DAEMON=${bindir}/${NAME} +DESC="LCDproc virtual console" +OPTIONS="" + +# installation check +test -x ${DAEMON} || exit 0 + +case "$1" in + start) + printf "Starting ${DESC}: " + start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} + printf "${NAME}." + ;; + stop) + printf "Stopping ${DESC}: " + start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} + printf "${NAME}." + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 + exit 1 + ;; +esac + +exit 0