Bug 56072

Summary: systemctl is-enabled fails with absolute path or basename missing "service"
Product: systemd Reporter: Judy Wathen <judy.wathen>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Judy Wathen 2012-10-17 07:18:28 UTC
Most systemctl "unit file" commands work with basename, basename without suffix, or absolute path now (October 17, 2012, 194 plus latest fixes).

However, "systemctl is-enabled", run on the booted system (not a chroot) fails when the argument is either an absolute path or a base name without the suffix (usually ".service").

Here are a couple examples:

 systemctl is-enabled /usr/lib/systemd/system/cups.service
Failed to issue method call: Invalid argument
[root@tw132001 yum.repos.d]# systemctl is-enabled cups
Failed to issue method call: Invalid argument
[root@tw132001 yum.repos.d]# systemctl is-enabled cups.service
disabled

For comparison, "systemctl enable" takes an argument in any format:

[root@tw132001 yum.repos.d]# systemctl enable cups
[root@tw132001 yum.repos.d]# echo $?
0
[root@tw132001 yum.repos.d]# systemctl enable cups.service
[root@tw132001 yum.repos.d]# echo $?
0
[root@tw132001 yum.repos.d]# systemctl enable /usr/lib/systemd/system/cups.service
[root@tw132001 yum.repos.d]# echo $?
0
[root@tw132001 yum.repos.d]#

This issue can be reproduced with cups, but other services will probably demonstrate the issue as well.
Comment 1 Lennart Poettering 2013-05-06 19:22:18 UTC
Fixed a while back.

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.