]> www.vanbest.org Git - sasc-ng.git/commitdiff
More detailed messaged if init script fails
authorJan-Pascal van Best <janpascal@vanbest.org>
Mon, 28 Jan 2013 08:45:30 +0000 (09:45 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Mon, 28 Jan 2013 08:45:30 +0000 (09:45 +0100)
debian/changelog
debian/sasc-ng-common.sasc-ng.default
debian/sasc-ng-common.sasc-ng.init

index 05e3b00854129997e6d0511d0afd7e4d5da15e7c..429ff3ab783ab84c5e2fd4b9be98561fec2c319b 100644 (file)
@@ -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 <janpascal@vanbest.org>  Mon, 28 Jan 2013 09:32:21 +0100
+ -- Jan-Pascal van Best <janpascal@vanbest.org>  Mon, 28 Jan 2013 09:44:27 +0100
 
 sasc-ng (620-4) local; urgency=low
 
index 648f1a3011860790a0a1f80f4f19757aebe9488e..d28a9b316c717fbfe1ec80f071f89532629b40a5 100755 (executable)
@@ -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
 
index 64303847976ad08b36095330ea399813ac80275b..7a99bc14ca58e31539eaead2324817d7a42708f8 100755 (executable)
@@ -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