In svc_homegrown in runscript.sh there is the loop for x in ${opts} ... (filter_environ; "${x}") ... fi In filter_environ in rc-services.sh there is the loop for x in $(declare -F) ... fi In these functions neither x is local. Thus the last value of x in filter_environ is the value after it returns, trouncing the value of x in svc_homegrown, which would be the homegrown opt. To fix, add local x to filter_environ. In fact, all functions should use local variables. Reproducible: Always Steps to Reproduce: 1. Take your init.d script (e.g., /etc/init.d/privoxy) 2. Add opts="${opts} foo" 3. Add foo() { einfo "Hello world" } 4. run /etc/init.d/privoxy foo Actual Results: cat: : No such file or directory Expected Results: * Hello world [ok] Portage 2.0.48-r7 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1) ================================================================= System uname: 2.4.20-gentoo-r5 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHzGENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/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="3dnow foomaticdb kde gnome libg++ mikmod nls png berkdb slang arts bonobo svga guile python esd qt motif alsa apm avi cdr crypt cups dga dvd emacs encode ethereal fbcon gd gdbm gif gpm gtk gtk2 gtkhtml icc icc-pgo imlib java jikes jpeg libwww lirc mad mmx mozilla mpeg ncurses oggvorbis opengl oss pam pcmcia pda pdflib perl quicktime readline samba sasl sdl slp snmp spell sse ssl tcpd tetex tiff truetype trusted usb wmf X Xaw3d xinerama xml xml2 xmms xv zlib x86" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium3 -O3 -pipe" CXXFLAGS="-march=pentium3 -O3 -pipe" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" FEATURES="sandbox ccache"
I forgot to add: I've been fiddling around with "stuff" so I hope this is actually a bug and I'm not wasting everybody's time.
x is local in homegrown, but not in filter_env svc_homegrown() { local arg="$1" local x= # Walk through the list of available options, looking for the # requested one. for x in ${opts}
Good call, thanks - shows you not to add a 'quick hack' =) Fixed in CVS, thanks.
*** Bug 26858 has been marked as a duplicate of this bug. ***
*** Bug 26556 has been marked as a duplicate of this bug. ***
az: this is a very good reason to push a .11 out the door ... all custom functions in init.d scripts are currently broken ...
Yes I know, just a bad week for me (still?) :/ I will really make effort this weekend to squich all the small ones, and get .11 going.