Commit d93190af authored by Dmitry Bogatov's avatar Dmitry Bogatov Committed by Chris Lamb

Check that packages that provide support for alternative init systems also...

Check that packages that provide support for alternative init systems also provide an init.d script. (Closes: #926471)
Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent 63c16542
Pipeline #50301 failed with stages
in 83 minutes and 14 seconds
......@@ -372,6 +372,21 @@ Info: The given init script appears to contain content from the
Please double-check the script and/or replace it with content suitable to
this binary package.
Tag: package-supports-alternative-init-but-no-init.d-script
Severity: important
Certainty: certain
Ref: policy 9.11
Info: The package provides daemon, but contains no init.d script
Packages that provide services (daemons), like cron daemon or web servers,
must provide init.d script for starting that services with sysvinit.
Optionally, packages can also provide integration with alternative init
systems.
.
Package in question provides integration with some alternative init system,
but corresponding init.d script is absent.
.
See <tt>init-d-script</tt>(5) for one of possible ways writing init.d scripts.
Tag: init.d-script-should-always-start-service
Severity: important
Certainty: possible
......
......@@ -86,6 +86,8 @@ sub run {
my (%initd_postinst, %initd_postrm);
check_missing_script($info);
# read postinst control file
if ($postinst and $postinst->is_file and $postinst->is_open_ok) {
my $fd = $postinst->open;
......@@ -502,6 +504,22 @@ sub check_defaults {
return;
}
# Check for missing init.d script, when equivalent for alternative init
# system is present.
sub check_missing_script {
my ($info) = @_;
for my $file ($info->sorted_index) {
if ( $file =~ m,etc/sv/([^/]+)/run$,
or $file =~ m,lib/systemd/system/(.*)\.service,) {
my $service = $1;
tag 'package-supports-alternative-init-but-no-init.d-script',$file
unless $info->index_resolved_path("etc/init.d/${service}");
}
}
return;
}
1;
# Local Variables:
......
Source: {$source}
Priority: optional
Section: mail
Maintainer: {$author}
Standards-Version: {$standards_version}
Build-Depends: {$build_depends}
Rules-Requires-Root: no
Package: {$source}
Architecture: {$package_architecture}
Depends: $\{misc:Depends\}
Description: Package with daemon, but no init.d script
This is a test package designed to exercise some feature or tag of
Lintian. It is part of the Lintian test suite and may do very odd
things. It should not be installed like a regular package. It may
be an empty package.
# Actual content does not matter, Lintain checks only for file names.
debian/bar.service /lib/systemd/system/
debian/run /etc/sv/foo/
Skeleton: upload-native
Testname: package-supports-alternative-init-but-no-init.d-script
Version: 1.0
Description: Check for daemon with missing init.d script
Match-Strategy: literal
Output-Format: EWI
Check: init.d
E: package-supports-alternative-init-but-no-init.d-script: package-supports-alternative-init-but-no-init.d-script etc/sv/foo/run
E: package-supports-alternative-init-but-no-init.d-script: package-supports-alternative-init-but-no-init.d-script lib/systemd/system/bar.service
I: package-supports-alternative-init-but-no-init.d-script: systemd-service-file-missing-documentation-key lib/systemd/system/bar.service
I: package-supports-alternative-init-but-no-init.d-script: systemd-service-file-missing-install-key lib/systemd/system/bar.service
......@@ -9,3 +9,9 @@ systemd-complex-service-file (binary): systemd-service-file-refers-to-obsolete-t
systemd-complex-service-file (binary): systemd-service-file-missing-install-key lib/systemd/system/test2.service
systemd-complex-service-file (binary): systemd-service-file-missing-documentation-key lib/systemd/system/test3.service
systemd-complex-service-file (binary): service-key-has-whitespace lib/systemd/system/test3.service at line 3
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test@.service
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test5.service
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test4.service
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test3.service
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test2.service
systemd-complex-service-file (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/test.service
......@@ -23,4 +23,6 @@ systemd-general (binary): script-in-etc-init.d-not-registered-via-update-rc.d et
systemd-general (binary): missing-systemd-service-for-init.d-rcS-script systemd-general
systemd-general (binary): maintainer-script-calls-systemctl postrm:6
systemd-general (binary): init.d-script-does-not-source-init-functions etc/init.d/systemd-general
systemd-general (binary): package-supports-alternative-init-but-no-init.d-script usr/lib/systemd/system/test.service
systemd-general (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/sourced.service
systemd-general (binary): init-script-is-not-a-file etc/init.d/fifo-pipe-as-init
systemd-missing-services-without-rcs (binary): missing-systemd-service-for-init.d-rcS-script systemd-missing-services-without-rcs
systemd-missing-services-without (binary): missing-systemd-service-for-init.d-script systemd-missing-services-without
systemd-missing-services-with (binary): systemd-service-file-missing-hardening-features lib/systemd/system/systemd-missing-services-with.service
systemd-missing-services-template (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/systemd-missing-services-template@.service
systemd-service-file-pidfile-refers-to-var-run-good (binary): systemd-service-file-pidfile-refers-to-var-run lib/systemd/system/systemd-service-file-pidfile-refers-to-var-run-good.service /var/run/$NAME.pid
systemd-service-file-pidfile-refers-to-var-run-good (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/systemd-service-file-pidfile-refers-to-var-run-good.service
systemd-service-file-pidfile-refers-to-var-run-bad (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/systemd-service-file-pidfile-refers-to-var-run-bad.service
systemd-service-file-shutdown-problems-good (binary): systemd-service-file-shutdown-problems lib/systemd/system/systemd-service-file-shutdown-problems-good.service
systemd-service-file-shutdown-problems-good (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/systemd-service-file-shutdown-problems-good.service
systemd-service-file-shutdown-problems-good (binary): description-too-long
systemd-service-file-shutdown-problems-bad (binary): package-supports-alternative-init-but-no-init.d-script lib/systemd/system/systemd-service-file-shutdown-problems-bad.service
systemd-service-file-shutdown-problems-bad (binary): description-too-long
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment