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

Bug#784905: jessie-pu: (preapproval) package qcontrol/0.5.4-1

Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian.org@packages.debian.org
Usertags: pu

I'd like to fix #781886 "qcontrol failure to start on boot sometimes (jessie,
systemd?)" in Jessie.

The issue is that when running in LSB compat mode the devices may not have been
created before the initscript runs. This isn't noticed under sysvinit because
there is an implicit (or perhaps explicit) udev settle somewhere earlier on.

However the proper fix (enabling full systemd support) is IMHO too intrusive
for a stable update (see below for the full patch in case you disagree). So
instead I would like to upload a workaround:

diff --git a/debian/qcontrol.qcontrold.init b/debian/qcontrol.qcontrold.init
index ccbcb22..55bd5a1 100644
--- a/debian/qcontrol.qcontrold.init
+++ b/debian/qcontrol.qcontrold.init
@@ -38,6 +38,11 @@ set -e
 case "$1" in
+       # Ensure that /dev/input/by-path/platform-gpio-keys-event has
+       # arrived. Under systemd LSB compatibility mode it may not
+       # have yet.
+       udevadm settle
        log_daemon_msg "Starting qcontrol daemon" "qcontrol"
        if start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- -d; then
                log_end_msg 0

I'm thinking that the best way to approach this would be to upload the
workaround to Sid and wait for it to propagate to Stretch, so it gets some
degree of real world testing and then upload the workaround upload to Jessie-pu
and carry on with the proper fix in Sid+Stretch (and probably jessie-backports).

How does that sound?


The full/proper fix (WIP) for Stretch, FYI (note that the build will autodetect
libsystemd-daemon-dev and enable some runtime support too):

diff --git a/debian/changelog b/debian/changelog
index 1b44c08..c4fb6ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 qcontrol (0.5.4-2) UNRELEASED; urgency=medium
   * Update Vcs-* to point to anonscm.
+  * Install and enable systemd unit files and corresponding udev rule.
+    (Closes: #781886)
  -- Ian Campbell <ijc@debian.org>  Sun, 14 Sep 2014 16:07:45 +0100
diff --git a/debian/control b/debian/control
index 573697f..7fa8ebc 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: qcontrol
 Section: utils
 Priority: optional
 Maintainer: Ian Campbell <ijc@debian.org>
-Build-Depends: debhelper (>= 9), liblua5.1-0-dev, pkg-config
+Build-Depends: debhelper (>= 9), libsystemd-daemon-dev, dh-systemd, liblua5.1-0-dev, pkg-config
 Standards-Version: 3.9.5
 Vcs-Git: git://anonscm.debian.org/collab-maint/qcontrol.git
 Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/qcontrol.git
diff --git a/debian/qcontrol.install b/debian/qcontrol.install
index ab7899e..25d1727 100644
--- a/debian/qcontrol.install
+++ b/debian/qcontrol.install
@@ -1 +1,4 @@
-qcontrol	usr/sbin/
+qcontrol			usr/sbin/
+systemd/qcontrold.service	lib/systemd/system/
+systemd/qcontrold.socket	lib/systemd/system/
+systemd/qcontrol.service	lib/systemd/system/
diff --git a/debian/qcontrol.rules b/debian/qcontrol.rules
new file mode 100644
index 0000000..6fdab10
--- /dev/null
+++ b/debian/qcontrol.rules
@@ -0,0 +1,3 @@
+# qcontrold.socket requires notification of
+# /dev/input/by-path/platform-gpio-keys-event's arrival
+KERNELS=="gpio-keys", SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", TAG+="systemd"
diff --git a/debian/rules b/debian/rules
index 9b88a50..a1ba03e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,11 +12,15 @@ UDEB_DIRS	= lib/debian-installer-startup.d \
 CONFIGS		= ts209.lua ts219.lua ts409.lua ts41x.lua
-	dh $@
+	dh $@ --with systemd
+	install -d debian/$(PACKAGE)/lib/udev/rules.d
+	install -m0644 debian/qcontrol.rules \
+		debian/$(PACKAGE)/lib/udev/rules.d/60-qcontrol.rules
 	# Install the following "manually" as they need a rename
 	@set -ex; $(foreach PACKAGE, $(PACKAGES), \
 	    $(foreach CONFIG, $(CONFIGS), \

-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, armel

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Reply to: