Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 227139 - gentoo-bashcomp support for rc-service
Summary: gentoo-bashcomp support for rc-service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2008-06-15 11:15 UTC by Justin Lecher (RETIRED)
Modified: 2009-06-17 06:02 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch for rc-service (rc-service.patch,2.72 KB, patch)
2009-05-03 21:20 UTC, Finn Wilke
Details | Diff
Fixed patch for rc-service (rc-service-r2.patch,3.14 KB, patch)
2009-05-05 11:58 UTC, Finn Wilke
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2008-06-15 11:15:55 UTC
Could the gentoo bashcomp definitions include the support for rc-service? This is a new interface for the service control and not included yet. 
I am not able to supply a patch, but would do testing if I can help that way.

Thanks justin

Reproducible: Always
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-02-23 03:20:12 UTC
Hi, I just started looking at gentoo-bashcomp and I will look into your request here. For now I am working on a new stable candidate release.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-14 03:04:15 UTC
Actually, you will need to mimic the _rcupdate() function in /usr/share/bash-completion/gentoo from gentoo-bashcomp to achieve this. To be frank, I don't have any motivation to do this because I think that rc-update is sufficient.
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2009-04-14 06:49:22 UTC
rc-update == managing the rc services
rc-services == running rc services
Comment 4 Finn Wilke 2009-05-03 21:20:07 UTC
Created attachment 190264 [details, diff]
proposed patch for rc-service

This should update the gentoo-bashcomp to include rc-service.
If you want to apply it to the installed thing do (as root)

"patch -d /etc/bash_completion.d/ -p2 < rc-service.patch"
to undo
"patch -R -d /etc/bash_completion.d/ -p2 < rc-service.patch"

The only problem it has is that it doesn't look inside the init scripts which options are available, it assumes that every option is included (ineed, iuse, needsme, pause, restart, start, status, stop, usesme, zap) If I forgot one, just mention, I'll fix it. If you or anyone who reads this is skilled in shell scripts I'd like to know how to achieve this functionality. :)
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-05-05 03:43:20 UTC
(In reply to comment #4)
> Created an attachment (id=190264) [edit]
> proposed patch for rc-service
> 
> This should update the gentoo-bashcomp to include rc-service.
> If you want to apply it to the installed thing do (as root)
> 
> "patch -d /etc/bash_completion.d/ -p2 < rc-service.patch"
> to undo
> "patch -R -d /etc/bash_completion.d/ -p2 < rc-service.patch"
> 
> The only problem it has is that it doesn't look inside the init scripts which
> options are available, it assumes that every option is included (ineed, iuse,
> needsme, pause, restart, start, status, stop, usesme, zap) If I forgot one,
> just mention, I'll fix it. If you or anyone who reads this is skilled in shell
> scripts I'd like to know how to achieve this functionality. :)
> 

I think you can just use grep to grab the options out of there. right?

Something like line 22 of http://sources.gentoo.org/viewcvs.py/gentoo-bashcomp/trunk/layman?annotate=84
Comment 6 Finn Wilke 2009-05-05 11:58:19 UTC
Created attachment 190401 [details, diff]
Fixed patch for rc-service

Yep, thanks.
I was a bit slow on the uptake. ;-)

I attached the fixed version with the grep thing. It should now only display the options included in the scripts to stop confusion.
Also custom options could be included into the init scripts and read by the completion script.
Comment 7 Roger 2009-06-12 00:53:55 UTC
Ping!  This patch committed yet?
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-06-13 02:17:56 UTC
Oops, forgot about this one. Thanks Finn!

Release is happening tonight.
Comment 9 Roger 2009-06-17 06:02:14 UTC
Many thanks for this patch.  I was just going to look into why rc-service wasn't listing init.d scripts using bash-completion!

Only took like 5 years and only after my bash script /usr/sbin/service started to fowl over.

Many thanks for this.  I can now easily use a gentoo related tool for checking services!  (The eselect tool is ridiculously overly complicated for managing init.d scripts.)