Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 52055 - rc-scripts and bash-completion fix/enhancement
Summary: rc-scripts and bash-completion fix/enhancement
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-25 15:41 UTC by Cory Visi (RETIRED)
Modified: 2004-05-25 18:34 UTC (History)
1 user (show)

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


Attachments
service.sh (service.sh,390 bytes, text/plain)
2004-05-25 15:46 UTC, Cory Visi (RETIRED)
Details
service-bash-completion (service-bash-completion,542 bytes, text/plain)
2004-05-25 15:47 UTC, Cory Visi (RETIRED)
Details
gentoo.diff (gentoo.diff,389 bytes, patch)
2004-05-25 15:49 UTC, Cory Visi (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cory Visi (RETIRED) gentoo-dev 2004-05-25 15:41:50 UTC
This is the implementation of a service script similar to Mandrake's to save a little typing for system admins. The service script was written by Kumba, and I wrote the bash-completion routine for it. A nice side effect is that you can then clean-up some of the bash-completion routines by encouraging the use of this script.

I believe the "service" script should be in /usr/sbin and be part of rc-scripts.

The bash-completion routine should be added to /etc/bash_completion.d/gentoo.

The gentoo.diff is a suggestion for clean-up of the gentoo bash completion. The reason for this is that bash completion for all the init.d scripts can confuse the completion with similarly-named applications. For instance, with bash-completion sourced:

# which squid
/usr/sbin/squid

# squid
broken   iuse     pause    start    usesme
ineed    needsme  restart  stop     zap

This is the wrong completion because the app name is the same as the init.d script name. An alternative to my diff is to change ${i##*/} to simply ${i}. This will enforce the proper path for the init scripts.

Let me know if this is helpful or if it needs to be worked on any further.

Joker was in the metadata.xml for bash-completion so I CC'd him.
Comment 1 Cory Visi (RETIRED) gentoo-dev 2004-05-25 15:46:14 UTC
Created attachment 32028 [details]
service.sh

Kumba, I made some small changes.
Comment 2 SpanKY gentoo-dev 2004-05-25 15:46:55 UTC
the 'service' thing in $PATH has come up before and has always been a WONTFIX

the bash-completion is something we can send upstream
Comment 3 Cory Visi (RETIRED) gentoo-dev 2004-05-25 15:47:15 UTC
Created attachment 32029 [details]
service-bash-completion
Comment 4 Cory Visi (RETIRED) gentoo-dev 2004-05-25 15:49:39 UTC
Created attachment 32030 [details, diff]
gentoo.diff
Comment 5 Cory Visi (RETIRED) gentoo-dev 2004-05-25 15:50:19 UTC
Well the bash-completion suggestion completely depends on the service script being used and in the path. So, I guess this bug is over before I even finished the attachments.
Comment 6 Joshua Kinard gentoo-dev 2004-05-25 16:01:07 UTC
eh, I've found this a useful little shortcut.  It's really minor, but it is nice to only type "service <service> <command>" rather than "/etc/init.d/<service> <command>" all the time.  I dunno, amybe something to think about for a baselayout release in the distant future.
Comment 7 SpanKY gentoo-dev 2004-05-25 16:06:35 UTC
yes, i know how it works, and like ive said, it's always been a WONTFIX before because we opted to not have a 'service' thing in $PATH ...

dont remember the exact bug # but i'm sure someone will find it
Comment 8 Aron Griffis (RETIRED) gentoo-dev 2004-05-25 18:34:39 UTC
Cory, I appreciate the time you took to put in this bug, along with the patches, but I'm going to close it WONTFIX for the following reasons:

"service " = 8 chars
"/etc/init.d/" = 12 chars

You succeeded in shaving off 4 characters on a relatively infrequent operation, i.e. starting/stopping services, at the expense of (1) making it less clear what is going on, (2) using the word "service" from the bin namespace, (3) adding something more to maintain.

IMHO the benefit is not worth it.  Thanks though!