Package: debhelper
Version: 9.20130516
Severity: normal

Hi Joey,

While fixing up debhelper in Ubuntu to match the dh_installinit upstart
implementation in Debian, I noticed that packages shipping upstart jobs
should have a versioned dependency on the version of sysv-rc whose
invoke-rc.d provides native support for upstart - otherwise, on upstart
systems the init script may be used instead of the upstart job in error.

This is more of an issue for Ubuntu than for Debian, since the versioned dep
is satisfied already in wheezy; but it would be correct to add it for Debian
as well, so I'm forwarding this patch on.

Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers saucy-updates
  APT policy: (500, 'saucy-updates'), (500, 'saucy-security'), (500, 'saucy')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
armhf

Kernel: Linux 3.9.0-2-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From c701061d7b3ded60d1a308aa2b004301df4a7bed Mon Sep 17 00:00:00 2001
From: Steve Langasek <steve.langa...@ubuntu.com>
Date: Fri, 17 May 2013 20:37:39 -0500
Subject: [PATCH] Packages with upstart jobs should carry a versioned
 dependency on sysv-rc

Depend on the version of invoke-rc.d that supports upstart jobs directly,
without which invoke-rc.d will incorrectly use the sysvinit script instead
of the upstart job when starting the service.
---
 dh_installinit | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dh_installinit b/dh_installinit
index e227006..3260866 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -224,6 +224,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
 	my $init=pkgfile($package,$script) || pkgfile($package,"init") ||
 		pkgfile($package,"init.d");
+
+	if ($job ne '' || ($dh{ONLYSCRIPTS} && -e "$tmp/etc/init/$jobfile.conf")) {
+		# minimal version of invoke-rc.d that supports upstart jobs
+		# directly
+		addsubstvar($package, "misc:Depends", "sysv-rc (>= 2.88dsf-24)");
+	}
+
 	if ($init ne '' && ! $dh{ONLYSCRIPTS}) {
 		if (! -d "$tmp/etc/init.d") {
 			doit("install","-d","$tmp/etc/init.d");
-- 
1.8.1.2

Reply via email to