Bug 37455

Summary: systemctl is-enabled returning 0 for both enabled and disabled services
Product: systemd Reporter: Stephen Haynes <beardix>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: systemctl is-enabled patch

Description Stephen Haynes 2011-05-22 02:18:35 UTC
The "systemctl is-enabled" command is returning an exit-code of 0 for both enabled and disabled services. The man page indicates that a non-zero exit code should be returned if the unit is disabled however this is not currently the case.

You can verify this by disabling a unit with "systemctl disable" followed by a "systemctl is-enabled" against the same unit which will return an exit code of 0.
Comment 1 Stephen Haynes 2011-05-22 02:24:56 UTC
I forgot to mention that this was against systemd 27.
Comment 2 Stephen Haynes 2011-05-28 02:13:20 UTC
Created attachment 47247 [details] [review]
systemctl is-enabled patch

The attached patch seems to fix this problem. After applying the patch systemctl is-enabled behaves as described in the man page.
Comment 3 Lennart Poettering 2011-06-15 13:15:22 UTC
A similar patch has now now been merged. Thanks a lot!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.