Bug#770344: dh-systemd: does not install service files with @ sign automatically

Luca Boccassi luca.boccassi at gmail.com
Thu May 26 18:56:12 BST 2016


Control: tags -1 patch

On Thu, 20 Nov 2014 17:06:35 +0100 Markus Koschany <apo at gambaru.de> wrote:
> Package: dh-systemd
> Version: 1.22
> Severity: wishlist
> 
> 
> Hi,
> 
> it would be nice if dh-systemd was able to install service files with
> the @ sign automatically. Those kind of files install template units but have
> to be explicitly installed into /lib/systemd/system.
> 
> When building --with systemd this file is detected and installed
> automatically
> 
> minetest-server.service
> 
> With this one nothing happens
> 
> minetest-server at .service
> 
> Regards,
> 
> Markus

Dear Maintainer,

I've attached a patch to enable installing templated units. I've tested
this on Jessie.
Works also when using dh_systemd_enable with the --name parameter and
the debian/package.name at .service format.

Thank you!

Kind regards,
Luca Boccassi


From 44d48ff37841b6cf0e0690d9848c7e95cb475cb4 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi at gmail.com>
Date: Thu, 26 May 2016 18:24:35 +0100
Subject: [PATCH] Add support for installing templated service unit

---
 script/dh_systemd_enable | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/script/dh_systemd_enable b/script/dh_systemd_enable
index cc8f46e..f000283 100755
--- a/script/dh_systemd_enable
+++ b/script/dh_systemd_enable
@@ -147,6 +147,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		doit("install","-p","-m644",$service,"$path/$script.service");
 	}
 
+	my $service=pkgfile("$package@","service");
+	if ($service ne '') {
+		my $path="$tmpdir/lib/systemd/system";
+		if (! -d "$path") {
+			doit("install","-d","$path");
+		}
+
+		doit("install","-p","-m644",$service,"$path/$script at .service");
+	}
+
 	my $target=pkgfile($package,"target");
 	if ($target ne '') {
 		my $path="$tmpdir/lib/systemd/system";
-- 
2.1.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20160526/383c8357/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list