FS#41719 - [systemd] 216-1 'systemctl restart' bash completion error

Attached to Project: Arch Linux
Opened by Raphaël Bois (vdust) - Wednesday, 27 August 2014, 17:08 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 03 September 2014, 11:33 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 18
Private No

Details

Description:
In bash, with bash-completion installed, doing

$ systemctl restart [TAB]

causes the bash completion on service name to fail with the following error:
'Failed to get properties: Unit name autovt@.service is not valid.'

It's caused by the following change in /usr/share/bash-completion/completions/systemctl (line 54):
-__get_all_units () { __systemctl $1 list-units --all \
+__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \

Now outputs files in the form 'name@.service', which are illegal names for 'systemctl show'.

Easy fix (line 185):
- [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
+ [[ "$line" =~ @\.|\.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 03 September 2014, 11:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed upstream for 217.
Comment by Vlalislav (dumphblooz) - Thursday, 28 August 2014, 03:50 GMT
Have same issue.
Comment by Andriy (helirexi) - Thursday, 28 August 2014, 20:16 GMT
Yes, also have this after today upgrade.
Thanks for easy fix!
Comment by Dave Reisner (falconindy) - Saturday, 30 August 2014, 00:41 GMT Comment by Hussam Al-Tayeb (hussam) - Wednesday, 03 September 2014, 10:01 GMT
This also happens with 'systemctl isolate'.
For example, type "systemctl isolate" then press tab and notice the "Failed to get properties: Unit name autovt@.service is not valid." warning.

Loading...