[systemd-devel] systemctl is-active command returns inactive even if the unit does not exist

Kevin Hsu hsukvn at gmail.com
Thu Jan 25 05:43:29 UTC 2018


Hi folks,

"systemctl is-active" command gives "inactive" no matter the unit exists
and indeed inactive or it just not exist. This behavior is semantically
true since a unit can never be active
if it does not exist. But "systemctl is-enabled" command will give a clear
result "Failed to get unit file state for no-exist.service: No such file or
directory" to indicate user the existence
of the given unit. I am wondering if "systemctl is-active" should behave
the same.


systemctl --version

systemd 235


systemctl is-active non-exist.service

inactive

systemctl is-enabled non-exist.service
Failed to get unit file state for non-exist.service: No such file or
directory

Best regards,
Kevin Hsu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180125/312a23cd/attachment.html>


More information about the systemd-devel mailing list