From: Jan-Pascal van Best Date: Mon, 28 Jan 2013 08:45:30 +0000 (+0100) Subject: More detailed messaged if init script fails X-Git-Tag: debian/620-6~2 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=5586b638ee777940ddda3da86b69bd4ffaf1d0fb;p=sasc-ng.git More detailed messaged if init script fails --- diff --git a/debian/changelog b/debian/changelog index 05e3b00..429ff3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ sasc-ng (620-5) local; urgency=low * Added example configuration files * Fix for logrotate crashing sasc-ng process + * Add commented-out CONFIGURED variable in /etc/default/sasc-ng + * Init scripts gives more detailed messages when not starting daemon - -- Jan-Pascal van Best Mon, 28 Jan 2013 09:32:21 +0100 + -- Jan-Pascal van Best Mon, 28 Jan 2013 09:44:27 +0100 sasc-ng (620-4) local; urgency=low diff --git a/debian/sasc-ng-common.sasc-ng.default b/debian/sasc-ng-common.sasc-ng.default index 648f1a3..d28a9b3 100755 --- a/debian/sasc-ng-common.sasc-ng.default +++ b/debian/sasc-ng-common.sasc-ng.default @@ -1,6 +1,10 @@ # Default settings for sasc-ng. This file is sourced by /bin/sh from # /etc/init.d/sasc-ng-common. +# Uncomment the following line when you've configured sasc-ng using +# this file and the files in /etc/sasc-ng +#CONFIGURED=yes + PIDFILE=/var/run/$NAME.pid LOGFILE=/var/log/$NAME.log diff --git a/debian/sasc-ng-common.sasc-ng.init b/debian/sasc-ng-common.sasc-ng.init index 6430384..7a99bc1 100755 --- a/debian/sasc-ng-common.sasc-ng.init +++ b/debian/sasc-ng-common.sasc-ng.init @@ -19,22 +19,37 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="sasc-ng" NAME=sasc-ng DAEMON=/usr/sbin/$NAME -SCRIPTNAME=/etc/init.d/sasc-ng-common +SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Exit if the module is not available -modprobe --dry-run --quiet dvbloopback || exit 0 +modprobe --dry-run --quiet dvbloopback || { + echo "Error: dvbloopback module not found" + echo "Please install the sasc-ng-daemon package for your" + echo "current kernel" + exit 0 +} # Exit if the kernel has no 'sasc' in its version name, # indicating it's not patched for sasc # TODO: check for exact kernel version -uname -v | grep -q sasc || exit 0 +uname -v | grep -q sasc || { + echo "Error: Not running a kernel patched for sasc-ng" + echo "Please reboot into a kernel with sasc in its version string" + exit 0 +} # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME +if [ "$CONFIGURED" != "yes" ]; then + echo "Error: sasc-ng not configured, exiting" + echo "Please modify the files in /etc/sasc-ng and /etc/default/sasc-ng" + exit 0 +fi + # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh