Completion for "service" only looks up /etc/init.d/

Bug #1188897 reported by Ma Hsiao-chun on 2013-06-08
This bug affects 8 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)

Bug Description

sudo service net TAB gives me "sudo service networking", i.e., no other candidates.

But at least sudo service network-manager restart is also valid and it is useful to workaround some NM bug.

$ ll /etc/init.d/net*
-rwxr-xr-x 1 root root 4322 May 18 13:37 /etc/init.d/networking*

$ ll /etc/init/net*
-rw-r--r-- 1 root root 2078 Dec 12 05:03 /etc/init/networking.conf
-rw-r--r-- 1 root root 803 Dec 12 05:03 /etc/init/network-interface.conf
-rw-r--r-- 1 root root 523 Dec 12 05:03 /etc/init/network-interface-container.conf
-rw-r--r-- 1 root root 1756 Dec 12 05:06 /etc/init/network-interface-security.conf
-rw-r--r-- 1 root root 568 Jan 22 07:59 /etc/init/network-manager.conf

I guess we should look up /etc/init/ also.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Peter Cordes (peter-cordes) wrote :

    COMPREPLY+=( $( initctl list 2>/dev/null | cut -d' ' -f1 ) )

to _services() does the trick.

submitted upstream

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.