Bug 476450

Summary: FutureRequest: add completeon for services
Product: [Fedora] Fedora Reporter: Pavel Alexeev <pahan>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: john5342, sheltren, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-16 07:43:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Alexeev 2008-12-14 21:53:51 UTC
Sorry, I can't find where fill future request. Please point me, if I should do that not in bugzilla.

I find very useful bash completion for services. Off course we can use /etc/init.d/[TAB] completion for that, but indeed it is not very comfortably.

Small googling, I found this script of completion in archlinux - http://bugs.archlinux.org/task/8481

This is require only one adjustment for Fedora on 3rd line replacement:
sysvdir=/etc/rc.d
to
sysvdir=/etc/init.d

May you, please add it in bash-completion package?

Comment 1 john5342 2008-12-15 04:32:07 UTC
Checked this and it appears this functionality is already present. With bash-completion installed at the bash propt:

service ipt[TAB]

completes to:

service iptables

Furthermore typing:

service [TAB][TAB]

Presents a list of services available. Is this what you were reffering to?

Comment 2 Pavel Alexeev 2008-12-15 11:27:13 UTC
Yes it is. But it is not worked for me before manual installing mentioned script.

What file refer to it in /usr/share/bash-completion/ ??

Comment 3 john5342 2008-12-15 16:12:55 UTC
Its not in /usr/share/bash-completion/*

Its in /etc/bash_completion

Comment 4 Pavel Alexeev 2008-12-16 07:26:22 UTC
Hm, sure it is present. So, this is my mistake in this case.

But may be it is because bash-completion required relogin to take effect? I install package, and don't find any completion after "service" keyword...
I think will more graceful if in %post script will be done all initialisation, what was made on login from .bashrc or similar scripts? Can we there source appropriate script for current user?

Comment 5 Ville Skyttä 2008-12-16 07:43:53 UTC
Sourcing it in %post would only affect the shell running the %post script, there's no sane way to push it into shells open elsewhere (and even if there was, I suppose it could be hard to decide which ones should it be pushed to).

As an alternative to relogin, you can source /etc/bash_completion manually after installing in shells where you want it.  Closing as notabug based on comment 4, thanks John for helping out.