mirror of
https://github.com/Jeffrey-Sardina/liberated-systemd.git
synced 2026-10-19 01:29:53 -05:00
systemctl: honour --root= in "is-enabled --full"
We have a root argument, let's make sure we honour it in this case.
This commit is contained in:
1 parent
0a4491ef3f
commit
b231b43ff0
2 files changed
+13
-1
No files matched your search
@@ -754,3 +754,15 @@ ID='the-id2'
|
||||
EOF
|
||||
|
||||
SYSTEMD_OS_RELEASE="/etc/os-release2" check_alias o 'the-id2'
|
||||
|
||||
: '-------is-enabled --full is relative to --root=-----------------'
|
||||
mkdir -p "$root/usr/lib/systemd/system"
|
||||
cat >"$root/usr/lib/systemd/system/rooted.service" <<EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
"$systemctl" --root="$root" enable rooted.service
|
||||
|
||||
# Without --root= being passed on this inspects the host, which knows nothing about this unit.
|
||||
"$systemctl" --root="$root" is-enabled --full rooted.service |
|
||||
grep "^ $root/etc/systemd/system/multi-user.target.wants/rooted.service\$" >/dev/null
|
||||
Reference in new issue
Block a user