Bug 6422 - inconsistencies in list-units output
Summary: inconsistencies in list-units output
Status: RESOLVED WONTFIX
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 20:12 CEST by Guillaume Rousse
Modified: 2012-06-25 10:10 CEST (History)
0 users

See Also:
Source RPM: systemd
CVE:
Status comment:


Attachments

Description Guillaume Rousse 2012-06-11 20:12:59 CEST
'systemd list-units' command, heavily used for shell completion, seems to regulary miss some units file installed in dedicated location.

For instance, the snmpd service cannot be found while inactive:
[root@beria cauldron]# ll /lib/systemd/system/snmpd.service 
-rw-r--r-- 1 root root 237 mai   31 11:27 /lib/systemd/system/snmpd.service
[root@beria cauldron]# systemctl list-units --all --full | grep snmp
[root@beria cauldron]# 

Once started, the service can be found normlly:
[root@beria cauldron]# systemctl start snmpd.service
[root@beria cauldron]# systemctl list-units --all | grep snmp
snmpd.service             loaded active   running       Simple Network Management Protocol (SNMP) Daemon.
Manuel Hiebel 2012-06-25 04:37:29 CEST

Assignee: bugsquad => mageia

Comment 1 Colin Guthrie 2012-06-25 10:10:55 CEST
Yeah the bash completion stuff is not perfect when dealing with such units. There was talk of adding a dedicated mode to systemctl to provide the information needed to bash completion, but that's not happened yet.

So the issue here is that the unit is disabled and thus does not show up in the list-units output. cf https://bugzilla.redhat.com/show_bug.cgi?id=748512

As noted above can also use list-unit-files which does show it up even when it's disabled as it doesn't rely on the current state.

[root@jimmy ~]# systemctl is-enabled snmpd.service 
disabled
[root@jimmy ~]# systemctl list-units --all --full | grep snmp
[root@jimmy ~]# systemctl enable snmpd.service 
ln -s '/lib/systemd/system/snmpd.service' '/etc/systemd/system/multi-user.target.wants/snmpd.service'
[root@jimmy ~]# systemctl list-units --all --full | grep snmp
snmpd.service                                                                                                  loaded inactive dead          Simple Network Management Protocol (SNMP) Daemon.
[root@jimmy ~]# systemctl disable snmpd.service 
rm '/etc/systemd/system/multi-user.target.wants/snmpd.service'
[root@jimmy ~]# systemctl list-units --all --full | grep snmp
[root@jimmy ~]# 


So for now it's not our downstream bug. I'd welcome you to go poke upstream about it, or, if you are super keen, write a patch for systemctl that could supply everything someone could want from a bash completion perspective!

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX


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