Bug 37455 - systemctl is-enabled returning 0 for both enabled and disabled services
Summary: systemctl is-enabled returning 0 for both enabled and disabled services
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-22 02:18 UTC by Stephen Haynes
Modified: 2011-06-15 13:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
systemctl is-enabled patch (1.22 KB, patch)
2011-05-28 02:13 UTC, Stephen Haynes
Details | Splinter Review

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.