The completions for services in the /etc/init.d directory comming with the bash-completion package (app-shells/bash-completion), are broken. The problem is that the completion package expects the RC scripts to return their usage information in a certain way, instead of the long and normally quite useful usage displayed in the Gentoo RC system. Maybe an option could be added to /sbin/runscript to display the format expected for the completion script, and then it could be added in the script. This would only be a small change. Reproducible: Always Steps to Reproduce: 1. Enter like /etc/init.d/<some service in that dir> 2. ..and press TAB. It just does default completion after a small delay. Actual Results: It just completes to filenames instead. Expected Results: Completed to RC script commands like start, stop and restart. Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) ================================================================= System uname: 2.4.20-gentoo-r5 i686 Celeron (Mendocino) GENTOO_MIRRORS=" http://ftp.easynet.nl/mirror/gentoo//" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss 3dnow apm arts avi crypt cups encode gif imlib java jpeg libg++ mikmod mmx motif mpeg ncurses nls oggvorbis opengl pdflib png quicktime sdl spell xml2 xmms xv zlib gdbm berkdb slang readline svga gpm tcpd pam libwww ssl perl python -X -gnome -kde -gtk -qt -truetype ruby mysql aalib directfb fbcon" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-O3 -mcpu=pentium2 -march=pentium2 -pipe" CXXFLAGS="-O3 -mcpu=pentium2 -march=pentium2 -pipe" ACCEPT_KEYWORDS="x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache"
The init.d completion is made for SysV style init which gentoo does not have. The problem is really generic and not a gentoo issue. The author would be needed to add gentoo support but that is not under my control. What i know for sure is that baselayout and rc init won't get changed just to make bash_completion work. (It's not under my control but i'm pretty sure) The gentoo specific init completion could maybe done in the gentoo specific section in the far future. I'm not the author of that script i can only send a suggestion to the creator.
Some init.d support has been added to bash-completion-20030821.ebuild to fix bug #26215. Only static keywords are supported for now.