diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-08-28 13:49:06 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-08-28 13:49:06 +0200 |
commit | f957e45d9f76317bb58b6163ddb27bd874baa916 (patch) | |
tree | eac0831b755db5afa707dd6883367fb24972873a /dh_installsystemd | |
parent | 259ab8a0d17d9846ae80a157b6636e9d22be131a (diff) | |
parent | bf161bdf9cf3e48245b220c25cebd3cc58d8a820 (diff) |
Merge vcs-git/main into dgit/sidHEADdebian/13.11.5archive/debian/13.11.5master
Thie merges the maintainer history so far into the dgit tree and
hopefully enables me to push it.
Diffstat (limited to 'dh_installsystemd')
-rwxr-xr-x | dh_installsystemd | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/dh_installsystemd b/dh_installsystemd index aba9d783..ec6fe860 100755 --- a/dh_installsystemd +++ b/dh_installsystemd @@ -249,30 +249,31 @@ sub extract_key { sub list_installed_units { my ($tmpdir, $aliases) = @_; - my $lib_systemd_system = "$tmpdir/lib/systemd/system"; my @installed; - return unless -d $lib_systemd_system; - opendir(my $dh, "$lib_systemd_system") or error("Cannot opendir($lib_systemd_system): $!"); - - foreach my $name (readdir($dh)) { - my $path = "$lib_systemd_system/$name"; - next unless -f $path; - if (-l "$path") { - my $dest = basename(readlink($path)); - $aliases->{$dest} //= [ ]; - push @{$aliases->{$dest}}, $name; - } else { - push @installed, $name; + foreach my $unitdir ("$tmpdir/lib/systemd/system", "$tmpdir/usr/lib/systemd/system") { + next unless -d $unitdir; + opendir(my $dh, "$unitdir") or error("Cannot opendir($unitdir): $!"); + + foreach my $name (readdir($dh)) { + my $path = "$unitdir/$name"; + next unless -f $path; + if (-l "$path") { + my $dest = basename(readlink($path)); + $aliases->{$dest} //= [ ]; + push @{$aliases->{$dest}}, $name; + } else { + push @installed, $name; + } } - } - closedir($dh); + closedir($dh); + } return @installed; } -# PROMISE: DH NOOP WITHOUT internal(bug#950723) tmp(lib/systemd/system) tmp(usr/lib/tmpfiles.d) tmp(etc/tmpfiles.d) mount path service socket target tmpfile timer cli-options() +# PROMISE: DH NOOP WITHOUT internal(bug#950723) tmp(lib/systemd/system) tmp(usr/lib/systemd/system) tmp(usr/lib/tmpfiles.d) tmp(etc/tmpfiles.d) mount path service socket target tmpfile timer cli-options() # Install package maintainer supplied unit files @@ -363,9 +364,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Must use while and shift because the loop alters the list. while (@args) { my $unit = shift @args; - my $path = "${tmpdir}/lib/systemd/system/${unit}"; - - error("Package '$package' does not install unit '$unit'.") unless (-f $path); + my $path = "${tmpdir}/usr/lib/systemd/system/${unit}"; + unless (-f $path) { + $path = "${tmpdir}/lib/systemd/system/${unit}"; + error("Package '$package' does not install unit '$unit'.") unless (-f $path); + } # Skip template service files. Enabling, disabling, starting # or stopping those services without specifying the instance |