SITL: encourage bash to create a subshell when spawning ardupilot

This issue is evident in Vagrant if you don't forward X.

_fdm_input_step determined there was no parent and killed ArduPilot.

Closed #3249
This commit is contained in:
Peter Barker 2015-12-11 14:06:13 +11:00 committed by Andrew Tridgell
parent eb73a2b0c9
commit 2c78b4f537
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ else
echo "Window access not found, logging to $filename"
cmd="$1"
shift
( $cmd $* &>$filename < /dev/null ) &
# the following "true" is to avoid bash optimising the following call
# to avoid creating a subshell. We need that subshell, or
# _fdm_input_step sees ArduPilot has no parent and kills ArduPilot!
( : ; $cmd $* &>$filename < /dev/null ) &
fi
exit 0