summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoscripts/postinst-init-tmpfiles2
-rwxr-xr-xdh_installinit12
2 files changed, 7 insertions, 7 deletions
diff --git a/autoscripts/postinst-init-tmpfiles b/autoscripts/postinst-init-tmpfiles
index e6cb7853..fd613bcd 100644
--- a/autoscripts/postinst-init-tmpfiles
+++ b/autoscripts/postinst-init-tmpfiles
@@ -1,5 +1,5 @@
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
- systemd-tmpfiles --create >/dev/null || true
+ systemd-tmpfiles --create #TMPFILES# >/dev/null || true
fi
diff --git a/dh_installinit b/dh_installinit
index 2daad639..29937c5e 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -254,21 +254,21 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (! $dh{NOSCRIPTS}) {
# Include postinst-init-tmpfiles if the package ships any files
# in /usr/lib/tmpfiles.d or /etc/tmpfiles.d
- my $got_tmpfile = undef;
my $tmpdir = tmpdir($package);
+ my @tmpfiles;
find({
wanted => sub {
return unless -f $File::Find::name;
- if (!$got_tmpfile &&
- $File::Find::name =~ m,^$tmpdir/usr/lib/tmpfiles\.d/, ||
+ if ($File::Find::name =~ m,^$tmpdir/usr/lib/tmpfiles\.d/, ||
$File::Find::name =~ m,^$tmpdir/etc/tmpfiles\.d/,) {
- $got_tmpfile = 1;
+ push @tmpfiles, $File::Find::name;
}
},
no_chdir => 1,
}, $tmpdir);
- if ($got_tmpfile) {
- autoscript($package,"postinst", "postinst-init-tmpfiles", "");
+ if (@tmpfiles > 0) {
+ autoscript($package,"postinst", "postinst-init-tmpfiles",
+ "s/#TMPFILES#/" . join(" ", map { basename($_) } @tmpfiles)."/");
}
if (! $dh{NO_START}) {