Bug 1024379 - systemctl: autocompletion for unit-names is broken
systemctl: autocompletion for unit-names is broken
Status: CLOSED DUPLICATE of bug 790768
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-29 10:37 EDT by Harald Reindl
Modified: 2014-10-14 20:18 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-14 20:18:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Harald Reindl 2013-10-29 10:37:04 EDT
the autocompletion is *seriously* broken

* systemctl start: no completion for disabled services
  that is ridiculous, the enabled and at boot starting ones
  are usually not needed to start, not often used and because that
  disabled ones are interesting here

* systemctl start: no completion for running services
  systemctl stop my.service; do something; systemctl start my.service
  no auto-completion for the start command  

* systemctl restart: completion for non-existent services
  [root@rh:~]$ systemctl restart mysqld
  mysqld-dbmail.service  mysqld.service
  fine, there is no "mysqld-dbmail.service" on this machine
  it is only referred in other unit-files as Before/After
______________________________

BTW:
the systemlog in case of stop a service is plain wrong
systemd knows if a service is running and so it has
not to log "Stopped" if it never did run and in case of
"condstop" this behavior is even more ridiculous 

[root@arrakisvm:~]$ cat messages 
[root@arrakisvm:~]$ systemctl status mysqld.service 
mysqld.service - MySQL/MariaDB Database
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
   Active: inactive (dead)

[root@arrakisvm:~]$ systemctl stop mysqld.service
[root@arrakisvm:~]$ cat messages 
Oct 29 15:35:13 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
[root@arrakisvm:~]$ systemctl stop mysqld.service
[root@arrakisvm:~]$ cat messages 
Oct 29 15:35:13 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:35:18 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.

[root@arrakisvm:~]$ cat messages 
Oct 29 15:35:13 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:35:18 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:07 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ systemctl condstop mysqld.service
[root@arrakisvm:~]$ cat messages 
Oct 29 15:35:13 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:35:18 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:07 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:10 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:12 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:12 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:13 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:14 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:14 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Oct 29 15:36:15 arrakisvm systemd[1]: Stopped MySQL/MariaDB Database.
Comment 1 Lennart Poettering 2014-03-24 16:16:31 EDT
Wow, you have weird definitions of "seriously".
Comment 2 Harald Reindl 2014-03-24 16:24:20 EDT
no, i have very clear definitions and state "stopped" to something never started is wrong and dumb, autocompletion only for enabled services is in case of "start" a bug as well as the autocompletion is completly weird

in your usecase of a single amchine you won't notice that

in larger usecaes where you write "condrestart service1 service2 service3" wo wrap a distribute-command "systemctl condrestart service1 service2 service3" around you have no benefit from the aztocompletion at all because the admin/testing-server doe snot have enabled all the services but installed becaus ehe pulls updates and distributes them
Comment 3 Diego 2014-09-09 04:11:01 EDT
I too I'm having problems with autocompletion, I can't get autocompletion for not enabled services.

Is there a specific reason for it being like that? This is particularly problematic for "start" and "status", like said.
Comment 4 Zbigniew Jędrzejewski-Szmek 2014-10-14 20:18:37 EDT

*** This bug has been marked as a duplicate of bug 790768 ***

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