diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2013-05-04 18:49:28 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-04 14:02:14 -0400 |
commit | 32726615cde7ebfe6b5b72a152b35202409526b1 (patch) | |
tree | 3a1bcdf971e0f03c6ab66f2fbbff3a81898e6828 /dh_installinit | |
parent | 632a2cd0b8591aac75b41840c6975c43e1bd2c5b (diff) |
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)
Diffstat (limited to 'dh_installinit')
-rwxr-xr-x | dh_installinit | 12 |
1 files changed, 6 insertions, 6 deletions
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}) { |