Systemd/src/systemctl
Lennart Poettering 3d083b2245 systemctl: load unit if needed in "systemctl is-active"
Previously, we'd explicitly use "GetUnit()" on the server side to
convert a unit name into a bus path, as that function will return an
error if the unit is not currently loaded. If we'd convert the path on
the client side, and access the unit this way directly the unit would be
loaded automatically in the background.

The old logic was done in order to minimize the effect of "is-active" on
the system, i.e. that a monoitoring command does not itself alter the
state of the system.

however, this is problematic as this can lead to confusing results if
the queried unit name is an alias that currently is not loaded: we'd
claim the unit wasn't active even though this isn't strictly true: the
unit the name is an alias for might be.

Hence, let's simplify the code, and accept that we might end up loading
a unit briefly here, and let's make "systemctl is-active" skip the
GetUnit() thing and calculate the unit path right away.

Fixes: #7875
2018-01-25 15:19:13 +01:00
..
systemctl.c systemctl: load unit if needed in "systemctl is-active" 2018-01-25 15:19:13 +01:00
systemd-sysv-install.SKELETON systemctl: drop hardcoded chkconfig invocation 2015-05-28 19:42:45 +02:00