Bug#803774: dh-systemd: please support enabling of mount files

Luca Boccassi lboccass at Brocade.com
Thu Mar 24 10:36:20 GMT 2016


Control: tags -1 patch

On Mon, 2 Nov 2015 08:15:37 -0800 Erik Ziegenbalg <eziegenb at brocade.com> wrote:
> Package: init-system-helpers
> Version: 1.24
> Severity: wishlist
> 
> Dear Maintainer,
> 
> I notice that dh-systemd-enable only supports enabling of service, socket, and
> tmpfile. This is a request to support enabling .mount files as well. I have diff 
> ready that implements this.
> 
> Thank you,
> Erik Ziegenbalg

Dear Maintainer(s),

I'm attaching inline the patch from my colleague, Erik.

Thank you!

-- 
Kind regards,
Luca Boccassi


From cd6b5fdd0e80bbd6538339faba69ca4a50597e7f Mon Sep 17 00:00:00 2001
From: eziegenb <eziegenb at brocade.com>
Date: Wed, 23 Mar 2016 13:07:11 -0700
Subject: [PATCH] Process mount files as well

---
 script/dh_systemd_enable | 12 +++++++++++-
 script/dh_systemd_start  |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/script/dh_systemd_enable b/script/dh_systemd_enable
index 39955c4..2e3d38c 100755
--- a/script/dh_systemd_enable
+++ b/script/dh_systemd_enable
@@ -102,7 +102,7 @@ sub contains_install_section {
 	return 0;
 }
 
-# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) service socket tmpfile
+# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) mount service socket tmpfile
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $tmpdir = tmpdir($package);
@@ -168,6 +168,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		doit("install","-p","-m644",$tmpfile,"$path/$script.conf");
 	}
 
+	my $mount=pkgfile($package,"mount");
+	if ($mount ne '') {
+		my $path="$tmpdir/usr/lib/system";
+		if (! -d "$path") {
+			doit("install","-d","$path");
+		}
+
+		doit("install","-p","-m644",$mount,"$path/$script.mount");
+	}
+
 	find({
 		wanted => sub {
 			my $name = $File::Find::name;
diff --git a/script/dh_systemd_start b/script/dh_systemd_start
index 4e22d59..0667c53 100755
--- a/script/dh_systemd_start
+++ b/script/dh_systemd_start
@@ -197,7 +197,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		push @{$aliases{$name}}, $_ for extract_key($name, 'Alias');
 		my @sysv = grep {
 				my $base = $_;
-				$base =~ s/\.(?:service|socket)$//g;
+				$base =~ s/\.(?:mount|service|socket)$//g;
 				-f "$tmpdir/etc/init.d/$base"
 			} ($base, @{$aliases{$name}});
 		if (@sysv == 0 && !grep { $_ eq $name } @units) {
-- 
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/20160324/53a339f1/attachment-0001.sig>


More information about the Pkg-systemd-maintainers mailing list