]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: if service manager couldn't load unit file, don't rely on it to tell us... 10959/head
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Nov 2018 16:26:53 +0000 (17:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 29 Nov 2018 10:25:32 +0000 (11:25 +0100)
commit02a126a33dc1709dfee2907f150a037787e61b99
tree5f3d5179faf61a2e5175e1499300ec752c60bfc6
parent85163756da6c559c9dc8ba3e035ecb587b2d48ef
systemctl: if service manager couldn't load unit file, don't rely on it to tell us the fragment path

Previously, "systemctl edit" exclusively used the service manager's
per-unit FragmentPath property to figure out which file to edit, when
operating on a non-template unit. If for some reason loading the unit
file failed entirely though (LoadState=error), then FragmentPath would
be empty, and thus the unit not editable.

Let's fix this, by falling back to client-side unit file searching in
this case.

(Also, various other clean-ups to make the relevant functions follow our
coding style)

Fixes: #9561
src/systemctl/systemctl.c