Your message dated Sun, 05 May 2013 04:02:34 +0000
with message-id <[email protected]>
and subject line Bug#690399: fixed in debhelper 9.20130504
has caused the Debian Bug report #690399,
regarding dh_installinit: add systemd support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
690399: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690399
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debhelper
Severity: wishlist
Tags: patch

Hello,

attached you can find a patch which adds support for systemd packaging
in dh_installinit, just like upstart is already supported.

The patch installs systemd files to /etc/systemd/system/ (see the patch
for rationale) and tmpfiles to /usr/lib/tmpfiles.d. Additionally it
calls systemctl daemon-reload (to pick up service file changes) and
systemd-tmpfiles --create (to apply tmpfiles changes) on systems where
systemd is running.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: armel
i386

Kernel: Linux 3.5.0 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debhelper depends on:
ii  binutils    2.22-6.1
ii  dpkg        1.16.4.3
ii  dpkg-dev    1.16.4.3
ii  file        5.11-1
ii  html2text   1.3.2a-15
ii  man-db      2.6.2-1
ii  perl        5.14.2-12
ii  po-debconf  1.0.16+nmu2

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  0.60

-- no debconf information
>From b544e0542f8663498f7b89c0b23f8e5fadff4a47 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <[email protected]>
Date: Sun, 29 Jul 2012 19:46:53 +0200
Subject: [PATCH] Support systemd in dh_installinit and postinst/postrm

---
 autoscripts/postinst-init         |    6 +++++
 autoscripts/postinst-init-nostart |    6 +++++
 autoscripts/postinst-init-restart |    6 +++++
 autoscripts/postrm-init           |    7 +++++
 dh_installinit                    |   51 +++++++++++++++++++++++++++++++++++--
 5 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init
index 2430b2c..f5371ce 100644
--- a/autoscripts/postinst-init
+++ b/autoscripts/postinst-init
@@ -1,4 +1,10 @@
 if [ -x "/etc/init.d/#SCRIPT#" ]; then
+	# In case this system is running systemd, we need to ensure that all
+	# necessary tmpfiles (if any) are created before starting.
+	if [ -d /sys/fs/cgroup/systemd ] ; then
+		systemd-tmpfiles --create >/dev/null || true
+	fi
+
 	update-rc.d #SCRIPT# #INITPARMS# >/dev/null
 	invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#
 fi
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
index 7a1bd5e..ec6bdbd 100644
--- a/autoscripts/postinst-init-nostart
+++ b/autoscripts/postinst-init-nostart
@@ -1,3 +1,9 @@
 if [ -x "/etc/init.d/#SCRIPT#" ]; then
+	# In case this system is running systemd, we need to ensure that all
+	# necessary tmpfiles (if any) are created before starting.
+	if [ -d /sys/fs/cgroup/systemd ] ; then
+		systemd-tmpfiles --create >/dev/null || true
+	fi
+
 	update-rc.d #SCRIPT# #INITPARMS# >/dev/null || #ERROR_HANDLER#
 fi
diff --git a/autoscripts/postinst-init-restart b/autoscripts/postinst-init-restart
index 35bba20..862f9cc 100644
--- a/autoscripts/postinst-init-restart
+++ b/autoscripts/postinst-init-restart
@@ -1,4 +1,10 @@
 if [ -x "/etc/init.d/#SCRIPT#" ]; then
+	# In case this system is running systemd, we need to ensure that all
+	# necessary tmpfiles (if any) are created before starting.
+	if [ -d /sys/fs/cgroup/systemd ] ; then
+		systemd-tmpfiles --create >/dev/null || true
+	fi
+
 	update-rc.d #SCRIPT# #INITPARMS# >/dev/null
 	if [ -n "$2" ]; then
 		_dh_action=restart
diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init
index 1c29298..61dcfc5 100644
--- a/autoscripts/postrm-init
+++ b/autoscripts/postrm-init
@@ -1,3 +1,10 @@
 if [ "$1" = "purge" ] ; then
 	update-rc.d #SCRIPT# remove >/dev/null
 fi
+
+
+# In case this system is running systemd, we make systemd reload the unit files
+# to pick up changes.
+if [ -d /sys/fs/cgroup/systemd ] ; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
diff --git a/dh_installinit b/dh_installinit
index 9c8c155..60277f6 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-dh_installinit - install init scripts and/or upstart jobs into package build directories
+dh_installinit - install init scripts and/or upstart jobs and/or systemd services into package build directories
 
 =cut
 
@@ -42,6 +42,16 @@ build directory.
 If this exists, it is installed into etc/init/I<package>.conf in the package
 build directory.
 
+=item debian/I<package>.service
+
+If this exists, it is installed into etc/systemd/system/I<package>.service in
+the package build directory.
+
+=item debian/I<package>.tmpfile
+
+If this exists, it is installed into usr/lib/tmpfiles.d/I<package>.conf in the
+package build directory.
+
 =back
 
 =head1 OPTIONS
@@ -88,6 +98,13 @@ is installed as in F<etc/default/> . This may be useful for daemons with names
 ending in B<d>. (Note: this takes precedence over the B<--init-script> parameter
 described below.)
 
+=item B<--systemd-lib>
+
+Install the system service files to lib/systemd/system instead of
+etc/systemd/system. This flag should B<only> be used when there is absolutely
+no reason whatsoever for any user to ever customize the service file (e.g. for
+service files like debian-fixup.service, udev.service or munin-node.service).
+
 =item B<-u>I<params> B<--update-rcd-params=>I<params>
 
 =item B<--> I<params>
@@ -141,6 +158,7 @@ init(options => {
 	"init-script=s" => \$dh{INIT_SCRIPT},
 	"update-rcd-params=s", => \$dh{U_PARAMS},
 	"remove-d" => \$dh{D_FLAG},
+	"systemd-lib" => \$dh{SYSTEMD_LIB},
 });
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
@@ -171,6 +189,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		$script=$package;
 	}       
 
+	my $service=pkgfile($package,"service");
+	if ($service ne '' && ! $dh{ONLYSCRIPTS}) {
+		my $path="$tmp/etc/systemd/system";
+		if ($dh{SYSTEMD_LIB}) {
+			$path="$tmp/lib/systemd/system";
+		}
+		if (! -d "$path") {
+			doit("install","-d","$path");
+		}
+
+		doit("install","-p","-m644",$service,"$path/$script.service");
+	}
+
+	my $tmpfile=pkgfile($package,"tmpfile");
+	if ($tmpfile ne '' && ! $dh{ONLYSCRIPTS}) {
+		my $path="$tmp/usr/lib/tmpfiles.d";
+		if (! -d "$path") {
+			doit("install","-d","$path");
+		}
+
+		doit("install","-p","-m644",$tmpfile,"$path/$script.conf");
+	}
+
 	my $job=pkgfile($package,"upstart");
 
 	if ($job ne '' && ! $dh{ONLYSCRIPTS}) {
@@ -203,7 +244,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		error("Can't use --init-script with an upstart job");
 	}
 
-	if ($job ne '' || $init ne '' || $dh{ONLYSCRIPTS}) {
+	# NB: The case that only $tmpfile is set makes no sense. The
+	# tmpfiles.d(5) mechanism is only available when using systemd (at
+	# least currently), so there has to be an init script which does the
+	# same thing for sysvinit.
+	if ($service ne '' || $job ne '' || $init ne '' || $dh{ONLYSCRIPTS}) {
 		# This is set by the -u "foo" command line switch, it's
 		# the parameters to pass to update-rc.d. If not set,
 		# we have to say "defaults".
@@ -265,4 +310,6 @@ Joey Hess <[email protected]>
 
 Steve Langasek <[email protected]>
 
+Michael Stapelberg <[email protected]>
+
 =cut
-- 
1.7.10.4


--- End Message ---
--- Begin Message ---
Source: debhelper
Source-Version: 9.20130504

We believe that the bug you reported is fixed in the latest version of
debhelper, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joey Hess <[email protected]> (supplier of updated debhelper package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 04 May 2013 23:32:27 -0400
Source: debhelper
Binary: debhelper
Architecture: source all
Version: 9.20130504
Distribution: unstable
Urgency: low
Maintainer: Joey Hess <[email protected]>
Changed-By: Joey Hess <[email protected]>
Description: 
 debhelper  - helper programs for debian/rules
Closes: 525821 680339 683551 683557 683941 684689 684895 686696 690378 690399 
691398 691557 692208 693100 700200 701233 703262 703515 706314
Changes: 
 debhelper (9.20130504) unstable; urgency=low
 .
   * dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
     used here rather than in dh_makeshlibs. Closes: #680339
   * dh_lintian: Source overrides doc improvement. Closes: #683941
   * dh_installmime: No longer makes maintainer scripts run update-mime and
     update-mime-database, that is now handled by triggers. Closes: #684689
     Thanks, Charles Plessy
   * python distutils buildsystem: Propagate failure of pyversions.
     Closes: #683551 Thanks, Clint Byrum
   * python distutils buildsystem: When checking if a version of python is
     installed, don't trust the presense of the executable, as
     a python2.X-minimal package may provide it while not having
     distutils installed. Closes: #683557, #690378
   * dh_icons: Improve documentation. Closes: #684895
   * Improve -X documentation. Closes: #686696
   * Support installing multiple doc-base files which use the same doc-id.
     Closes: #525821
   * dh_installdocs: Support having the same document id in different binary
     packages built from the same source.
     Closes: #525821 Thanks, Don Armstrong
   * dh_installdeb: Avoid unnecessary is_udeb tests. Closes: #691398
   * Updated German man page translation. Closes: #691557, #706314
   * dh_installinit: Support systemd.
     Closes: #690399 Thanks, Michael Stapelberg
   * Updated French man page translation. Closes: #692208
   * dh_icons: Reword description. Closes: #693100
   * Avoid find -perm +mode breakage caused by findutils 4.5.11,
     by instead using -perm /mode. Closes: #700200
   * cmake: Configure with -DCMAKE_BUILD_TYPE=RelWithDebInfo
     Closes: #701233
   * dh_auto_test: Avoid doing anything when cross-compiling. Closes: #703262
   * dh_testdir: Fix error message. Closes: #703515
Checksums-Sha1: 
 d85b2648ca8d1fc90ad43584d3bd5875dee44db6 1577 debhelper_9.20130504.dsc
 da3e094d2b0a61f6aeadfe1f0ed5c6bdcea67877 470050 debhelper_9.20130504.tar.gz
 3c1da0c1f75877cafa598b677b5c1e9366560b51 706414 debhelper_9.20130504_all.deb
Checksums-Sha256: 
 9dd245024b2be9230bcd6569c617d2dae39e19c206cb639c72e4e252c3c86d3b 1577 
debhelper_9.20130504.dsc
 7d6ee2657430afcb477396c32c4bc170aa7fae97332045aa8f4ebec889051f01 470050 
debhelper_9.20130504.tar.gz
 08450bd3fbae0bcef04e60d299c8557634e35f027a446a454ab574f8948d2419 706414 
debhelper_9.20130504_all.deb
Files: 
 6823c687eb955536e3d5d32b69a7dd41 1577 devel optional debhelper_9.20130504.dsc
 b5ea99c845e78cecbc89d25484a46b42 470050 devel optional 
debhelper_9.20130504.tar.gz
 fe4f489a57e830c66c6b2fbac672cdf4 706414 devel optional 
debhelper_9.20130504_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIVAwUBUYXVcckQ2SIlEuPHAQj8sw//R3bheMCm70k4D33QJ9Xc8wVHlcYgmY2f
Bi7ChTYcCtgyazS7yZmQ759Sh+m9vn11v/qqzVNKsxhIUnjjHFLWWfpcdCdn//Zp
6aAmRN0OT6ovLYFBAbuB80EBeSOE41QjKLUV1M7IU7DoFi+kCWWFHpv2Pni1XP/B
c7GqNAOI9CDKXEivyrgcv+UIA1PGCGz3Pk8J3ZF8Jy5GT2zelmvczj00uDVj/jUf
qWjQRirHrpOpmH8gcImhmlTS02WD6vAfNYuCa98HCh2o6QxWLx9tvgGRkudvHUr4
U4rT6ITAakVELQyVLbG/C9AhnHSMW96OT5ew834w3jcbPcXu9qMeTyUQyo/I9Od8
Wtipn28JoG9D04omMQMktXV8rdu1jfY8splBkow+kE7gIkjCpk6WkwBBd5XqvWAq
Xihf7eijRM1E2GbbEACg4pnVa1YynoZqhQhHf1V3bhoxYHtRbWHfV+KwXNznob/p
kOuOuftGpYANvP66E8kI9IDu612x95+Wn2G1KhLhvuX9CPXr/JDe3+fsYpvpGmJz
dZlVD787+LjEc3p5+sx+IGngNEjUa8CecIsJhir1Z6rZ9mGIPkVZZeEWBAXTi+kz
c8h4elA2ebSeB9qTHX5iXNbgtxmdkBZiddhb5dyF89DA25FQHcgm0GQu9Pmocido
lkNNVbB1DvU=
=YmiJ
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to