i've got problem with some init scripts while using bash-3.1 (tested with bash-3.1_p5-r2 and bash-3.1_p7). the scripts reports it started successfully, but daemon isn't started in fact. i've noticed this behaviour with 2 scripts: nvtv and portmap. what's strange - the daemons are started in both case, when i simple copy start-stop-daemon ... procedure from script and paste it to "live" shell. problem disapeard after downgrading to bash-3.0
hehe - jakub: i'm not sure if you're right with changing summary. i suspect it's more general problem. i've noticed it only with those two scripts, but i assume, that there can be more broken. anyway - let it be...;>
you neglected to post `emerge info` portmap script works just fine for me with bash-3.1_p7
portmap also works fine with bash-3.1_p7 on my x86 laptop
well - but it doesn't work for me;/ here's my emerge info: Portage 2.1_pre4-r1 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.6-r2, 2.6.14-VBE_3.0-MPPE_1.3-PINK i686) ================================================================= System uname: 2.6.14-VBE_3.0-MPPE_1.3-PINK i686 AMD Athlon(tm) XP 1700+ Gentoo Base System version 1.12.0_pre12 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5, 2.4.2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O3 -pipe -mfpmath=sse -ffast-math -DNDEBUG -DG_DISABLE_ASSERT -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O3 -pipe -mfpmath=sse -ffast-math -DNDEBUG -DG_DISABLE_ASSERT" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig collision-protect cvs digest distlocks fixpackages parallel-fetch sandbox sfperms spinner strict" GENTOO_MIRRORS="#http://gentoo.zie.pg.gda.pl/ http://gentoo.prz.rzeszow.pl http://src.gentoo.pl/distfiles" LANG="en_US" LINGUAS="pl" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/portage/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local" SYNC="cvs://mkay@cvs.gentoo.org:/var/cvsroot" USE="x86 3dnow 3dnowext X aac alsa amarok apache2 arts avi bitmap-fonts canvas cpudetection crypt cups divx4linux dvd dvdr eds emboss encode extraicons extramodules fbcon ffmpeg fla fortran gd gif glut gpgme gpm gstreamer gtk gtk2 imlib imlib2 javascript jikes jpeg jpeg2k kde kdeenablefinal kdexdeltas lcms ldap libwww lm_sensors mad mailwrapper mbox memlimit mikmod mmx mmxext motif mp3 mpeg ncurses nls nocardbus nptl nvidia ogg oggvorbis opengl oss pam pda perl png ppds python qt quicktime readline real sasl sdl serial sse ssl tcpd truetype truetype-fonts type1-fonts usb userlocales v4l v4l2 videos vim-with-x vorbis win32codecs wmf xv xvid zlib elibc_glibc kernel_linux linguas_pl userland_GNU" Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LC_ALL, LDFLAGS (note i've also tried to compile bash with empty C*FLAGS) i've added -x to #!/bin/bash in runscript.sh and here's log from starting portmap: 1 + start-stop-daemon --start --quiet --exec /sbin/portmap -- 2 ++ requote --start --quiet --exec /sbin/portmap -- 3 ++ local 'q='\''' 4 ++ set -- --start --quiet --exec /sbin/portmap -- 5 ++ set -- ''\''--start' ''\''--quiet' ''\''--exec' ''\''/sbin/portmap' ''\''--' 6 ++ set -- ''\''--start'\''' ''\''--quiet'\''' ''\''--exec'\''' ''\''/sbin/portmap'\''' ''\''--'\''' 7 ++ echo ''\''--start'\'' '\''--quiet'\'' '\''--exec'\'' '\''/sbin/portmap'\'' '\''--'\''' 8 + local 'args='\''--start'\'' '\''--quiet'\'' '\''--exec'\'' '\''/sbin/portmap'\'' '\''--'\''' result i 9 + local cmd pidfile pid stopping signal nothing=false 10 + local daemonfile=/var/lib/init.d/daemons/portmap 11 + RC_DAEMONS=() 12 + RC_PIDFILES=() 13 + local -a RC_DAEMONS RC_PIDFILES 14 + [[ -e /var/lib/init.d/daemons/portmap ]] 15 + rc_setup_daemon_vars 16 + local name i 17 + sargs=("${args%% \'--\' *}") 18 + local -a sargs 19 + local -a eargs 20 + local 'x='\''--start'\'' '\''--quiet'\'' '\''--exec'\'' '\''/sbin/portmap'\'' '\''--'\''' 21 + [[ '--start' '--quiet' '--exec' '/sbin/portmap' '--' != \'\-\-\s\t\a\r\t\'\ \'\-\-\q\u\i\e\t\'\ \'\-\-\e\x\e\c\'\ \'\/\s\b\i\n\/\p\o\r\t\m\a\p\'\ \'\-\-\' ]] 22 + rc_shift_args ''\''--start'\''' ''\''--quiet'\''' ''\''--exec'\''' ''\''/sbin/portmap'\''' ''\''--'\''' 23 + [[ 5 != \0 ]] 24 + [[ '--start' != \-* ]] 25 + [[ -n '' ]] 26 + unset addvar 27 + case "$1" in 28 + shift 29 + [[ 4 != \0 ]] 30 + [[ '--quiet' != \-* ]] 31 + [[ -n '' ]] 32 + unset addvar 33 + case "$1" in 34 + shift 35 + [[ 3 != \0 ]] 36 + [[ '--exec' != \-* ]] 37 + [[ -n '' ]] 38 + unset addvar 39 + case "$1" in 40 + shift 41 + [[ 2 != \0 ]] 42 + [[ '/sbin/portmap' != \-* ]] 43 + [[ -n '' ]] 44 + unset addvar 45 + case "$1" in 46 + shift 47 + [[ 1 != \0 ]] 48 + [[ '--' != \-* ]] 49 + [[ -n '' ]] 50 + unset addvar 51 + case "$1" in 52 + shift 53 + [[ 0 != \0 ]] 54 + [[ -z 5 ]] 55 + [[ -z '' ]] 56 + cmd= 57 ++ bash_variable portmap 58 ++ local args=portmap 59 ++ LC_ALL=C 60 ++ echo portmap 61 + local bash_service=portmap 62 + eval 'x="${RC_DAEMON_portmap}"' 63 ++ x= 64 + [[ -n '' ]] 65 + return 0 66 + false 67 + rc_stop_daemon 68 + local pid pids retval=0 69 + [[ -n '' ]] 70 + [[ -s '' ]] 71 + [[ -z '' ]] 72 + return 0 73 + result=0 74 + [[ 0 == \0 ]] 75 + (( i=0 )) 76 + (( i<0 )) 77 + [[ 0 == \0 ]] 78 + [[ -f /var/lib/init.d/daemons/portmap ]] 79 + return 0 80 + local ret=0 81 + eend 0 82 + local retval=0 83 + shift 84 + _eend 0 eerror '' 85 + local retval=0 efunc=eerror msg 86 + shift 2 87 + [[ 0 == \0 ]] 88 + [[ no == \y\e\s ]] 89 + msg='^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m' 90 + [[ yes == \y\e\s ]] 91 + echo -e '^[[A^[[112C ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m' 92 ^[[A^[[112C ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m 93 + return 0 94 + LAST_E_CMD=eend 95 + return 0 96 + sleep 1 97 + return 0 98 + retval=0 99 + service_inactive portmap 100 + test_service_state portmap inactive 101 + [[ -z portmap ]] 102 + [[ -z inactive ]] 103 + local f=/var/lib/init.d/inactive/portmap 104 + [[ -L /var/lib/init.d/inactive/portmap ]] 105 + [[ ! -e /var/lib/init.d/inactive/portmap ]] 106 + rm -f /var/lib/init.d/inactive/portmap 107 + return 1 108 + [[ 0 != 0 ]] 109 + mark_service_started portmap 110 + [[ -z portmap ]] 111 + ln -snf /etc/init.d/portmap /var/lib/init.d/started/portmap 112 + local retval=0 113 + [[ -f /var/lib/init.d/starting/portmap ]] 114 + rm -f /var/lib/init.d/starting/portmap 115 + [[ -f /var/lib/init.d/inactive/portmap ]] 116 + [[ -f /var/lib/init.d/stopping/portmap ]] 117 + return 0 118 + service_message 'Service portmap started OK' 119 + [[ no != \y\e\s ]] 120 + return 121 + return 0 122 + '[' -n /tmp/pmap_table.dC2iHy ']' 123 + ebegin 'Reloading portmap table' 124 + local 'msg=Reloading portmap table' dots spaces= 125 + [[ no == \y\e\s ]] 126 + [[ -n '' ]] 127 + msg='Reloading portmap table ...' 128 + einfon 'Reloading portmap table ...' 129 + [[ no == \y\e\s ]] 130 + [[ yes != \y\e\s ]] 131 + echo -ne ' ^[[32;01m*^[[0m Reloading portmap table ...' 132 ^[[32;01m*^[[0m Reloading portmap table ...+ LAST_E_CMD=einfon 133 + return 0 134 + [[ yes == \y\e\s ]] 135 + echo 136 137 + LAST_E_LEN=30 138 + LAST_E_CMD=ebegin 139 + return 0 140 + pmap_set 141 + eend 0 'Error reloading portmap table.' 142 + local retval=0 143 + shift 144 + _eend 0 eerror 'Error reloading portmap table.' 145 + local retval=0 efunc=eerror msg 146 + shift 2 147 + [[ 0 == \0 ]] 148 + [[ no == \y\e\s ]] 149 + msg='^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m' 150 + [[ yes == \y\e\s ]] 151 + echo -e '^[[A^[[112C ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m' 152 ^[[A^[[112C ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m 153 + return 0 154 + LAST_E_CMD=eend 155 + return 0 156 + rm -f /tmp/pmap_table.dC2iHy 157 + service_started portmap 158 + test_service_state portmap started 159 + [[ -z portmap ]] 160 + [[ -z started ]] 161 + local f=/var/lib/init.d/started/portmap 162 + [[ -L /var/lib/init.d/started/portmap ]] 163 + return 0 in lines 38-46 we've got: + unset addvar + case "$1" in + shift + [[ 2 != \0 ]] + [[ '/sbin/portmap' != \-* ]] + [[ -n '' ]] + unset addvar + case "$1" in + shift in bash-3.0 it looks like: + unset addvar + case "$1" in + addvar=cmd + shift + [[ 2 != \0 ]] + [[ /sbin/portmap != \-* ]] + [[ -n cmd ]] + [[ -z '' ]] + eval 'cmd="/sbin/portmap"' ++ cmd=/sbin/portmap + shift then lines 53-67: + [[ 0 != \0 ]] + [[ -z 5 ]] + [[ -z '' ]] + cmd= ++ bash_variable portmap ++ local args=portmap ++ LC_ALL=C ++ echo portmap + local bash_service=portmap + eval 'x="${RC_DAEMON_portmap}"' ++ x= + [[ -n '' ]] + return 0 + false + rc_stop_daemon with bash-3.0: + [[ 0 != \0 ]] + [[ -z 5 ]] + [[ -z /sbin/portmap ]] ++ bash_variable portmap ++ local args=portmap ++ LC_ALL=C ++ echo portmap + local bash_service=portmap + eval 'x="${RC_DAEMON_portmap}"' ++ x= + [[ -n '' ]] + return 0 + false + false + rc_start_daemon i suspect soemthing's wrong here
you cant expect to have this stuff work when you keep using old versions of baselayout ... upgrade to 1.12.0_pre15