Bug 1024379 - systemctl: autocompletion for unit-names is broken
Summary: systemctl: autocompletion for unit-names is broken
Keywords:
Status: CLOSED DUPLICATE of bug 790768
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 19
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: 2013-10-29 14:37 UTC by Harald Reindl
Modified: 2014-10-15 00:18 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-15 00:18:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald Reindl 2013-10-29 14:37:04 UTC
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 20:16:31 UTC
Wow, you have weird definitions of "seriously".

Comment 2 Harald Reindl 2014-03-24 20:24:20 UTC
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 08:11:01 UTC
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-15 00:18:37 UTC

*** 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.