From 9079d6121a13a402e895ac915dd95f88b6d62bc8 Mon Sep 17 00:00:00 2001 From: Ilia Date: Sat, 23 Apr 2022 01:14:19 +0300 Subject: [PATCH] Use recommended `/etc/systemd/system` by default --- init/init-lib.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init/init-lib.pl b/init/init-lib.pl index c22445bf6..4d7a31fe9 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -2400,12 +2400,17 @@ sub get_systemd_root { my ($name) = @_; if ($name) { - foreach my $p ("/etc/systemd/system", "/usr/lib/systemd/system", - "/lib/systemd/system") { + foreach my $p ( + "/etc/systemd/system", + "/usr/lib/systemd/system", + "/lib/systemd/system") { if (-r "$p/$name.service" || -r "$p/$name") { return $p; } + } } +if (-d "/etc/systemd/system") { + return "/etc/systemd/system"; } if (-d "/usr/lib/systemd/system") { return "/usr/lib/systemd/system";