[SCM] Debian package checker branch, master, updated. 2.3.0-8-g136d3c9
The following commit has been merged in the master branch:
commit c9fed37f383fcfaa48225b3e74d980e5ced72262
Author: Raphael Geissert <atomo64@gmail.com>
Date: Sat Dec 26 23:09:41 2009 -0600
Warn about init scripts with incomplete start runlevels
Some init scripts, incorrectly, do not start in all four 2-5 runlevels,
only in some of them.
diff --git a/checks/init.d b/checks/init.d
index b4220f2..f2d633e 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -285,6 +285,17 @@ sub check_init {
$runlevel;
}
}
+
+ # No script should start at one of the 2-5 runlevels but not at
+ # all of them
+ my $start = join(' ', sort grep {$_ =~ /^[2-5]$/} keys %start);
+ if (length($start) > 0 and $start ne '2 3 4 5') {
+ my $base = $initd_file;
+ $base =~ s,.*/,,;
+ my @missing = grep { !defined $start{$_} } qw(2 3 4 5);
+ tag 'init.d-script-missing-start', "/etc/init.d/$_",
+ @missing;
+ }
}
if (defined $lsb{'default-stop'}) {
my %stop;
diff --git a/checks/init.d.desc b/checks/init.d.desc
index 15e0cbc..358bae0 100644
--- a/checks/init.d.desc
+++ b/checks/init.d.desc
@@ -294,6 +294,15 @@ Info: The given <tt>/etc/init.d</tt> script indicates it should be
it probably needs the same handling when halting the system (runlevel 0)
or switching to single-user mode (runlevel 1).
+Tag: init.d-script-missing-start
+Severity: normal
+Certainty: certain
+Info: The given <tt>/etc/init.d</tt> script indicates it should be
+ started at one of the runlevels 2-5 but not at all of them. This is a
+ mistake. The system administrators should be given the opportunity to
+ customize the runlevels at their will.
+Ref: policy 9.3.3.1
+
Tag: init.d-script-missing-dependency-on-remote_fs
Severity: important
Certainty: possible
diff --git a/t/tests/init.d-lsb-headers/debian/debian/control.in b/t/tests/init.d-lsb-headers/debian/debian/control.in
index d8becea..a339b2a 100644
--- a/t/tests/init.d-lsb-headers/debian/debian/control.in
+++ b/t/tests/init.d-lsb-headers/debian/debian/control.in
@@ -44,3 +44,11 @@ Description: {$description} -- using /var files
This is another test package designed to exercise the checking of init
scripts by Lintian. It is part of the Lintian test suite and may do
very odd things. It should not be installed like a regular package.
+
+Package: {$srcpkg}-missing
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} -- missing runlevels
+ This is yet another test package designed to exercise the checking of
+ init scripts by Lintian. It is part of the Lintian test suite and may
+ do very odd things. It should not be installed like a regular package.
diff --git a/t/tests/init.d-general/debian/debian/init.d-general.init b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers-missing.init
similarity index 53%
copy from t/tests/init.d-general/debian/debian/init.d-general.init
copy to t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers-missing.init
index 97ef8f1..651e3d6 100644
--- a/t/tests/init.d-general/debian/debian/init.d-general.init
+++ b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers-missing.init
@@ -3,16 +3,16 @@
set -e
### BEGIN INIT INFO
-# Provides: init.d-general
+# Provides: init.d-lsb-headers-missing
# Required-Start:
# Required-Stop:
-# Default-Start:
-# Default-Stop:
-# Short-Description: Do nothing at all
+# Default-Start: 2 3 5
+# Default-Stop: 0 6
+# Short-Description: Just a test script
### END INIT INFO
case "$1" in
start|stop|force-reload|restart|status|*)
- echo hello world!
+ echo hello world
;;
esac
diff --git a/t/tests/init.d-lsb-headers/desc b/t/tests/init.d-lsb-headers/desc
index 32c6463..058e3a9 100644
--- a/t/tests/init.d-lsb-headers/desc
+++ b/t/tests/init.d-lsb-headers/desc
@@ -10,6 +10,7 @@ Test-For:
init.d-script-has-conflicting-start-stop
init.d-script-missing-dependency-on-remote_fs
init.d-script-missing-dependency-on-local_fs
+ init.d-script-missing-start
init.d-script-possible-missing-stop
init.d-script-provides-virtual-facility
init.d-script-should-depend-on-virtual-facility
diff --git a/t/tests/init.d-lsb-headers/tags b/t/tests/init.d-lsb-headers/tags
index cbbbb4e..ab27782 100644
--- a/t/tests/init.d-lsb-headers/tags
+++ b/t/tests/init.d-lsb-headers/tags
@@ -4,6 +4,8 @@ E: init.d-lsb-headers: init.d-script-should-depend-on-virtual-facility /etc/init
E: init.d-lsb-headers: init.d-script-should-depend-on-virtual-facility /etc/init.d/init.d-lsb-headers portmap -> $portmap
E: init.d-lsb-headers: init.d-script-should-depend-on-virtual-facility /etc/init.d/init.d-lsb-headers sysklogd -> $syslog
I: init.d-lsb-headers: init.d-script-does-not-provide-itself /etc/init.d/init.d-lsb-headers
+W: init.d-lsb-headers-missing: init.d-script-missing-start /etc/init.d/init.d-lsb-headers-missing 4
+W: init.d-lsb-headers-missing: init.d-script-possible-missing-stop /etc/init.d/init.d-lsb-headers-missing 1
W: init.d-lsb-headers-parsing: init.d-script-has-conflicting-start-stop /etc/init.d/init.d-lsb-headers-parsing 0
W: init.d-lsb-headers-parsing: init.d-script-possible-missing-stop /etc/init.d/init.d-lsb-headers-parsing 1 6
W: init.d-lsb-headers-parsing: init.d-script-starts-in-stop-runlevel /etc/init.d/init.d-lsb-headers-parsing 0
--
Debian package checker
Reply to: