diff --git a/webbuild/webbuild-sudo b/webbuild/webbuild-sudo index 315fb0d..a296237 100755 --- a/webbuild/webbuild-sudo +++ b/webbuild/webbuild-sudo @@ -127,11 +127,15 @@ cmdtmpfile=`mktemp --tmpdir=$WEBBUILD_STATEDIR/tmp --suffix=.webbuildcmd` if [ "$MODE" = "background" ]; then if [ "$WORKINGHOME" ]; then [ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\"" - $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | tr -d '\f' > $cmdtmpfile & + # WARNING: don't add pipes after $COMMAND or command pid will be wrong + $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;stdbuf -o L $COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile & + # | tr -d '\f' #sed "s|<|\<|g" | else [ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"$COMMAND\"" - $SUCMDPREFIX "$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | sed "s|<|\<|g" | tr -d '\f' > $cmdtmpfile & + # WARNING: don't add pipes after $COMMAND or command pid will be wrong + $SUCMDPREFIX "$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile & + # | sed "s|<|\<|g" | tr -d '\f' fi echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes echo "Started background command: $COMMAND"