[SCM] Debian package checker branch, master, updated. 2.2.14-44-gfee7702
The following commit has been merged in the master branch:
commit 58fd58e81f3448362584f176a0390de02295c7dc
Author: Raphael Geissert <atomo64@gmail.com>
Date: Thu Aug 27 12:13:07 2009 -0500
Tag init scripts that are started in runlevels 0 and 6
diff --git a/checks/init.d b/checks/init.d
index a5634d5..1feb6ce 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -254,6 +254,8 @@ sub check_init {
for my $runlevel (split (/\s+/, $lsb{'default-start'})) {
if ($runlevel =~ /^[sS0-6]$/) {
$start{lc $runlevel} = 1;
+ tag "init.d-script-starts-in-stop-runlevel", "/etc/init.d/$_ $runlevel"
+ if ($runlevel =~ /^(?:0|6)$/);
} else {
tag "init.d-script-has-bad-start-runlevel", "/etc/init.d/$_ $runlevel";
}
diff --git a/checks/init.d.desc b/checks/init.d.desc
index eec11a0..fcea053 100644
--- a/checks/init.d.desc
+++ b/checks/init.d.desc
@@ -227,3 +227,13 @@ Info: The given <tt>/etc/init.d</tt> script seems to be sourcing an
any time, and init scripts are required to handle the situation
gracefully.
Ref: policy 9.3.2
+
+Tag: init.d-script-starts-in-stop-runlevel
+Severity: normal
+Certainty: certain
+Info: This <tt>/etc/init.d</tt> script specifies the 6 or 0 runlevel in
+ Default-Start in its LSB keyword section. The 0 and 6 runlevels are
+ meant to only stop services, not to start them. If the intention is
+ to do something that might not exactly be stopping a service at one of
+ those runlevels the script should anyway specify them in Default-Stop
+ and perform the actions when passed the <tt>stop</tt> argument.
diff --git a/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
index 620d667..5971a40 100644
--- a/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
+++ b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
@@ -6,7 +6,7 @@ set -e
# Provides: nothing
# Required-Start:
# Required-Stop:
-# Default-Start: X
+# Default-Start: 0 6 X
# Default-Stop: S Y
# Short-Description: Do nothing at all
### END INIT INFO
diff --git a/t/tests/init.d-lsb-headers/desc b/t/tests/init.d-lsb-headers/desc
index 58499c1..2186d53 100644
--- a/t/tests/init.d-lsb-headers/desc
+++ b/t/tests/init.d-lsb-headers/desc
@@ -6,3 +6,4 @@ Test-For:
init.d-script-has-bad-start-runlevel
init.d-script-has-bad-stop-runlevel
init-d-script-stops-in-s-runlevel
+ init.d-script-starts-in-stop-runlevel
diff --git a/t/tests/init.d-lsb-headers/tags b/t/tests/init.d-lsb-headers/tags
index 0fe75cb..a4a4d27 100644
--- a/t/tests/init.d-lsb-headers/tags
+++ b/t/tests/init.d-lsb-headers/tags
@@ -1,3 +1,5 @@
W: init.d-lsb-headers: init-d-script-stops-in-s-runlevel /etc/init.d/init.d-lsb-headers
W: init.d-lsb-headers: init.d-script-has-bad-start-runlevel /etc/init.d/init.d-lsb-headers X
W: init.d-lsb-headers: init.d-script-has-bad-stop-runlevel /etc/init.d/init.d-lsb-headers Y
+W: init.d-lsb-headers: init.d-script-starts-in-stop-runlevel /etc/init.d/init.d-lsb-headers 0
+W: init.d-lsb-headers: init.d-script-starts-in-stop-runlevel /etc/init.d/init.d-lsb-headers 6
--
Debian package checker
Reply to: