From 32726615cde7ebfe6b5b72a152b35202409526b1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 May 2013 18:49:28 +0200 Subject: dh_installinit: call systemd-tmpfiles with the config file names This makes the invocation more specific and thus less likely to have any unwanted side effects. The invocation before was: systemd-tmpfiles --create >/dev/null || true With this commit, it becomes: systemd-tmpfiles --create bacula.conf >/dev/null || true (for bacula-fd shipping /etc/tmpfiles.d/bacula.conf) --- dh_installinit | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dh_installinit') 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}) { -- cgit v1.2.3