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.
Created attachment 32028 [details] service.sh Kumba, I made some small changes.
the 'service' thing in $PATH has come up before and has always been a WONTFIX the bash-completion is something we can send upstream
Created attachment 32029 [details] service-bash-completion
Created attachment 32030 [details, diff] gentoo.diff
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.
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.
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
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!