[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/04: Add systemd-provided names to init whitelist



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit b88561d0f1fa1fc36f22a335f3873bd801e7a393
Author: Felipe Sateler <fsateler@debian.org>
Date:   Thu Jul 16 19:19:39 2015 -0300

    Add systemd-provided names to init whitelist
    
    Strip .sh suffixes, as those are removed by the systemd sysv generator
    Copy bootmisc.sh from initscripts as a test
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/systemd.pm                                 |  5 +-
 data/systemd/init-whitelist                       | 39 +++++++++++++++
 t/tests/systemd-general/debian/debian/bootmisc.sh | 59 +++++++++++++++++++++++
 t/tests/systemd-general/debian/debian/rules       |  1 +
 t/tests/systemd-general/tags                      |  1 +
 5 files changed, 104 insertions(+), 1 deletion(-)

diff --git a/checks/systemd.pm b/checks/systemd.pm
index fd5b83a..e59510e 100644
--- a/checks/systemd.pm
+++ b/checks/systemd.pm
@@ -71,7 +71,10 @@ sub get_init_scripts {
     my @scripts;
     if (my $initd_path = $info->index_resolved_path('etc/init.d/')) {
         for my $init_script ($initd_path->children) {
-            next if $INIT_WHITELIST->known($init_script->basename);
+            # sysv generator drops the .sh suffix
+            my $basename = $init_script->basename;
+            $basename =~ s/\.sh$//;
+            next if $INIT_WHITELIST->known($basename);
             next
               if $init_script->is_symlink
               && $init_script->link eq '/lib/init/upstart-job';
diff --git a/data/systemd/init-whitelist b/data/systemd/init-whitelist
index 555d48e..b9d7a42 100644
--- a/data/systemd/init-whitelist
+++ b/data/systemd/init-whitelist
@@ -3,3 +3,42 @@ README
 skeleton
 rc
 rcS
+
+# Names provided/masked by systemd
+# Generated from the systemd links
+# sed -n -e 's|^.\+[[:space:]]\+/lib/systemd/system/\([^/]\+\)\.service$|\1|p' debian/systemd.links
+urandom
+procps
+rc.local
+module-init-tools
+kmod
+x11-common
+hostname
+rmnologin
+bootmisc
+fuse
+bootlogd
+stop-bootlogd-single
+stop-bootlogd
+hwclock
+mountkernfs
+mountdevsubfs
+mountall
+mountall-bootclean
+mountnfs
+mountnfs-bootclean
+umountfs
+umountnfs
+umountroot
+checkfs
+checkroot
+checkroot-bootclean
+cryptdisks
+cryptdisks-early
+single
+killprocs
+sendsigs
+halt
+reboot
+motd
+bootlogs
diff --git a/t/tests/systemd-general/debian/debian/bootmisc.sh b/t/tests/systemd-general/debian/debian/bootmisc.sh
new file mode 100755
index 0000000..5c73683
--- /dev/null
+++ b/t/tests/systemd-general/debian/debian/bootmisc.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          bootmisc
+# Required-Start:    $remote_fs
+# Required-Stop:
+# Should-Start:      udev
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Miscellaneous things to be done during bootup.
+# Description:       Some cleanup.  Note, it need to run after mountnfs-bootclean.sh.
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+[ "$DELAYLOGIN" ] || DELAYLOGIN=yes
+. /lib/init/vars.sh
+
+do_start () {
+	#
+	# If login delaying is enabled then create the flag file
+	# which prevents logins before startup is complete
+	#
+	case "$DELAYLOGIN" in
+	  Y*|y*)
+		echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
+		;;
+	esac
+
+	# Create /var/run/utmp so we can login.
+	: > /var/run/utmp
+	if grep -q ^utmp: /etc/group
+	then
+		chmod 664 /var/run/utmp
+		chgrp utmp /var/run/utmp
+	fi
+
+	# Remove bootclean's flag files.
+	# Don't run bootclean again after this!
+	rm -f /tmp/.clean /run/.clean /run/lock/.clean
+	rm -f /tmp/.tmpfs /run/.tmpfs /run/lock/.tmpfs
+}
+
+case "$1" in
+  start|"")
+	do_start
+	;;
+  restart|reload|force-reload)
+	echo "Error: argument '$1' not supported" >&2
+	exit 3
+	;;
+  stop|status)
+	# No-op
+	;;
+  *)
+	echo "Usage: bootmisc.sh [start|stop]" >&2
+	exit 3
+	;;
+esac
+
+:
diff --git a/t/tests/systemd-general/debian/debian/rules b/t/tests/systemd-general/debian/debian/rules
index f952939..ef793af 100644
--- a/t/tests/systemd-general/debian/debian/rules
+++ b/t/tests/systemd-general/debian/debian/rules
@@ -12,6 +12,7 @@ override_dh_install:
 	install -m 0755 -d $(INITD_DIR) $(SYSD_DIR)
 	mkfifo $(INITD_DIR)/fifo-pipe-as-init
 	mkfifo $(SYSD_DIR)/fifo-pipe-as-init.service
+	install -m 0755 debian/bootmisc.sh $(INITD_DIR)
 	touch $(INITD_DIR)/README
 
 override_dh_fixperms:
diff --git a/t/tests/systemd-general/tags b/t/tests/systemd-general/tags
index 3dc3b91..d570cdb 100644
--- a/t/tests/systemd-general/tags
+++ b/t/tests/systemd-general/tags
@@ -12,6 +12,7 @@ E: systemd-general: systemd-service-file-outside-lib usr/lib/systemd/system/test
 E: systemd-general: systemd-tmpfiles.d-outside-usr-lib etc/tmpfiles.d/test.conf
 W: systemd-general: init.d-script-does-not-source-init-functions etc/init.d/systemd-general
 W: systemd-general: maintainer-script-calls-systemctl postrm:6
+W: systemd-general: script-in-etc-init.d-not-registered-via-update-rc.d etc/init.d/bootmisc.sh
 W: systemd-general: script-in-etc-init.d-not-registered-via-update-rc.d etc/init.d/fifo-pipe-as-init
 W: systemd-general: systemd-service-file-refers-to-obsolete-target etc/systemd/system/test.service syslog.target
 W: systemd-general: systemd-service-file-refers-to-obsolete-target usr/lib/systemd/system/test.service syslog.target

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: