webbuild-sudo: fix getting job pid in background mode
This commit is contained in:
parent
14d27be655
commit
aee7f737b1
@ -127,11 +127,15 @@ cmdtmpfile=`mktemp --tmpdir=$WEBBUILD_STATEDIR/tmp --suffix=.webbuildcmd`
|
|||||||
if [ "$MODE" = "background" ]; then
|
if [ "$MODE" = "background" ]; then
|
||||||
if [ "$WORKINGHOME" ]; then
|
if [ "$WORKINGHOME" ]; then
|
||||||
[ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\""
|
[ "$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" |
|
#sed "s|<|\<|g" |
|
||||||
else
|
else
|
||||||
[ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"$COMMAND\""
|
[ "$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
|
fi
|
||||||
echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
|
echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
|
||||||
echo "Started background command: $COMMAND"
|
echo "Started background command: $COMMAND"
|
||||||
|
Loading…
Reference in New Issue
Block a user