fix LSB init headers; add pidfile & configfile handling to debian init scripts
This commit is contained in:
@@ -4,7 +4,7 @@ Priority: extra
|
||||
Maintainer: Jose Luis Tallon <jltallon@adv-solutions.net>
|
||||
Build-Depends: debhelper (>= 5.0.0), pkg-config, xmlto, libncurses5-dev, libusb-dev (>= 0.1.8), libsvga1-dev, libxosd-dev
|
||||
Uploaders: Jonathan Oxer <jon@debian.org>
|
||||
Standards-Version: 3.7.2.0
|
||||
Standards-Version: 3.7.3
|
||||
|
||||
Package: lcdproc
|
||||
Architecture: any
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
# shall LCDd be started (yes/no)
|
||||
START=no
|
||||
|
||||
# config file
|
||||
#CONFIGFILE=/etc/lcdproc/LCDd.conf
|
||||
|
||||
# options for LCDd startup
|
||||
OPTIONS="-c /etc/lcdproc/LCDd.conf"
|
||||
OPTIONS=""
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
#### BEGIN INIT INFO
|
||||
### 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: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: LCDproc Server Daemon
|
||||
# Description: Debian init script for LCDd, the display
|
||||
# server daemon in the LCDproc suite
|
||||
@@ -19,6 +20,9 @@ NAME=${NAME:-LCDd}
|
||||
DAEMON=/usr/sbin/LCDd
|
||||
DESC="LCDproc display server daemon"
|
||||
DEFAULTS=/etc/default/$NAME
|
||||
CONFIGFILE=/etc/lcdproc/$NAME.conf
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
OPTIONS=""
|
||||
START=yes
|
||||
|
||||
# Source defaults file; edit that file to configure this script.
|
||||
@@ -26,6 +30,18 @@ if [ -e "${DEFAULTS}" ]; then
|
||||
. "${DEFAULTS}"
|
||||
fi
|
||||
|
||||
# try to get PID file name from config file (not used yet)
|
||||
if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then
|
||||
PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \
|
||||
| head -n1 \
|
||||
| cut -d= -f2- \
|
||||
| sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'`
|
||||
OPTIONS="${OPTIONS} -c ${CONFIGFILE}"
|
||||
fi
|
||||
|
||||
# if necessary set default PID file name (not used yet)
|
||||
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
|
||||
|
||||
# If we're not to start the daemon, simply exit
|
||||
if [ "${START}" != "yes" ]; then
|
||||
exit 0
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# shall lcdproc be started (yes/no)
|
||||
START=no
|
||||
|
||||
# config file
|
||||
#CONFIGFILE=/etc/lcdproc/lcdproc.conf
|
||||
|
||||
# options for lcdproc startup
|
||||
#OPTIONS="C G"
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
#### BEGIN INIT INFO
|
||||
### 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: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: LCDproc system status information viewer
|
||||
# Description: Debian init script for lcdproc, the system
|
||||
# status information viewer in the LCDproc suite
|
||||
@@ -19,6 +20,9 @@ NAME=${NAME:-lcdproc}
|
||||
DAEMON=/usr/bin/lcdproc
|
||||
DESC="LCDproc system status monitor"
|
||||
DEFAULTS=/etc/default/$NAME
|
||||
CONFIGFILE=/etc/lcdproc/$NAME.conf
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
OPTIONS=""
|
||||
START=yes
|
||||
|
||||
# Source defaults file; edit that file to configure this script.
|
||||
@@ -26,6 +30,18 @@ if [ -e "${DEFAULTS}" ]; then
|
||||
. "${DEFAULTS}"
|
||||
fi
|
||||
|
||||
# try to get PID file name from config file
|
||||
if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then
|
||||
PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \
|
||||
| head -n1 \
|
||||
| cut -d= -f2- \
|
||||
| sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'`
|
||||
OPTIONS="${OPTIONS} -c ${CONFIGFILE}"
|
||||
fi
|
||||
|
||||
# if necessary set default PID file name
|
||||
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
|
||||
|
||||
# If we're not to start the daemon, simply exit
|
||||
if [ "${START}" != "yes" ]; then
|
||||
exit 0
|
||||
@@ -41,12 +57,12 @@ test -x $DAEMON || exit 5
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
start_daemon $DAEMON $OPTIONS
|
||||
start_daemon -p $PIDFILE $DAEMON $OPTIONS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
killproc $DAEMON
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# shall lcdexec be started (yes/no)
|
||||
START=no
|
||||
|
||||
# config file
|
||||
#CONFIGFILE=/etc/lcdproc/lcdexec.conf
|
||||
|
||||
# options for lcdexec startup
|
||||
#OPTIONS=""
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
#### BEGIN INIT INFO
|
||||
### BEGIN INIT INFO
|
||||
# Provides: lcdexec
|
||||
# Required-Start: $syslog $local_fs $network $remote_fs
|
||||
# Required-Stop: $syslog $local_fs $network $remote_fs
|
||||
# Should-Start: LCDd
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Default-Stop: 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
|
||||
@@ -19,6 +20,9 @@ NAME=${NAME:-lcdexec}
|
||||
DAEMON=/usr/bin/lcdexec
|
||||
DESC="LCDproc program starter"
|
||||
DEFAULTS=/etc/default/$NAME
|
||||
CONFIGFILE=/etc/lcdproc/$NAME.conf
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
OPTIONS=""
|
||||
START=no
|
||||
|
||||
# Source defaults file; edit that file to configure this script.
|
||||
@@ -26,6 +30,18 @@ if [ -e "${DEFAULTS}" ]; then
|
||||
. "${DEFAULTS}"
|
||||
fi
|
||||
|
||||
# try to get PID file name from config file
|
||||
if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then
|
||||
PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \
|
||||
| head -n1 \
|
||||
| cut -d= -f2- \
|
||||
| sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'`
|
||||
OPTIONS="${OPTIONS} -c ${CONFIGFILE}"
|
||||
fi
|
||||
|
||||
# if necessary set default PID file name
|
||||
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
|
||||
|
||||
# If we're not to start the daemon, simply exit
|
||||
if [ "${START}" != "yes" ]; then
|
||||
exit 0
|
||||
@@ -41,12 +57,12 @@ test -x $DAEMON || exit 5
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
start_daemon $DAEMON $OPTIONS
|
||||
start_daemon -p $PIDFILE $DAEMON $OPTIONS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
killproc $DAEMON
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# shall lcdvc be started (yes/no)
|
||||
START=no
|
||||
|
||||
# config file
|
||||
#CONFIGFILE=/etc/lcdproc/lcdvc.conf
|
||||
|
||||
# options for lcdvc startup
|
||||
#OPTIONS=""
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
#### BEGIN INIT INFO
|
||||
### BEGIN INIT INFO
|
||||
# Provides: lcdvc
|
||||
# Required-Start: $syslog $local_fs $network $remote_fs
|
||||
# Required-Stop: $syslog $local_fs $network $remote_fs
|
||||
# Should-Start: LCDd
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: LCDproc virtual console
|
||||
# Description: Debian init script for lcdvc, the virtual
|
||||
# console client in the LCDproc suite
|
||||
@@ -19,6 +20,9 @@ NAME=${NAME:-lcdvc}
|
||||
DAEMON=/usr/bin/lcdvc
|
||||
DESC="LCDproc virtual console"
|
||||
DEFAULTS=/etc/default/$NAME
|
||||
CONFIGFILE=/etc/lcdproc/$NAME.conf
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
OPTIONS=""
|
||||
START=no
|
||||
|
||||
# Source defaults file; edit that file to configure this script.
|
||||
@@ -26,6 +30,18 @@ if [ -e "${DEFAULTS}" ]; then
|
||||
. "${DEFAULTS}"
|
||||
fi
|
||||
|
||||
# try to get PID file name from config file
|
||||
if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then
|
||||
PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \
|
||||
| head -n1 \
|
||||
| cut -d= -f2- \
|
||||
| sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'`
|
||||
OPTIONS="${OPTIONS} -c ${CONFIGFILE}"
|
||||
fi
|
||||
|
||||
# if necessary set default PID file name
|
||||
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
|
||||
|
||||
# If we're not to start the daemon, simply exit
|
||||
if [ "${START}" != "yes" ]; then
|
||||
exit 0
|
||||
@@ -41,12 +57,12 @@ test -x $DAEMON || exit 5
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
start_daemon $DAEMON $OPTIONS
|
||||
start_daemon -p $PIDFILE $DAEMON $OPTIONS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
killproc $DAEMON
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
|
||||
@@ -108,10 +108,10 @@ binary-arch: build install
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
dh_installinit # for the lcdproc client
|
||||
dh_installinit --update-rcd-params="defaults 21 79" # for the lcdproc client
|
||||
dh_installinit --name=LCDd
|
||||
dh_installinit --name=lcdexec
|
||||
dh_installinit --name=lcdvc
|
||||
dh_installinit --name=lcdexec --update-rcd-params="defaults 21 79"
|
||||
dh_installinit --name=lcdvc --update-rcd-params="defaults 21 79"
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
|
||||
Reference in New Issue
Block a user