Bug 725745 - systemctl is-enabled not working correctly
Summary: systemctl is-enabled not working correctly
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-26 12:48 UTC by cornel panceac
Modified: 2011-12-16 00:25 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-16 00:25:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description cornel panceac 2011-07-26 12:48:13 UTC
Description of problem:
systemctl is-enabled foo.service does not display anything on screen if the service file exists, and displays an error if it doesn't exist.

Version-Release number of selected component (if applicable):
26-8

How reproducible:
always

Steps to Reproduce:
1. 
2.
3.
  
Actual results:
nothing

Expected results:
is / not enabled

Additional info:

; echo $? displays 0 if the service file exists, 1 if it doesn't

Comment 1 cornel panceac 2011-07-26 14:07:13 UTC
To clarify last line above: it displays 0 whether the service is enabled or not, as long as it's not in /lib/*/ .

Example:

# systemctl enable sshd.socket

# ls -l /lib/systemd/system/*wants/ | grep -i sshd

# ls -l /etc/systemd/system/*wants/ | grep -i sshd
lrwxrwxrwx. 1 root root 31 Jul 26 16:45 sshd.socket -> /lib/systemd/system/sshd.socket

# systemctl is-enabled sshd.socket;echo $?
0

# systemctl disable sshd.socket
rm '/etc/systemd/system/sockets.target.wants/sshd.socket'

# systemctl is-enabled sshd.socket;echo $?
1

But

# ls /lib/systemd/system/multi-user.target.wants/
dbus.service                   getty.target           plymouth-quit-wait.service  systemd-ask-password-wall.path
fedora-sysinit-unhack.service  plymouth-quit.service  rc-local.service            systemd-user-sessions.service

# mv /lib/systemd/system/multi-user.target.wants/rc-local.service ~

# systemctl --system daemon-reload

# ls /lib/systemd/system/*wants/ | grep -i rc-local

# ls /etc/systemd/system/*wants/ | grep -i rc-local

# systemctl is-enabled rc-local.service ; echo $?
0

Comment 2 cornel panceac 2011-07-28 06:43:55 UTC
Oops, returns 0 as long as it *is* under /lib . Sorry for this.

Comment 3 Fedora Admin XMLRPC Client 2011-10-20 16:28:45 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Michal Schmidt 2011-12-16 00:25:41 UTC
In F16 this is fixed - 'systemctl is-enabled ...' prints the state to stdout.
It's not the kind of change that would be good to backport at this point, so WONTFIX for F15.


Note You need to log in before you can comment on or make changes to this bug.