@@ -34,12 +34,18 @@ dbus-update-activation-environment --systemd MIR_SOCKET=$MIR_SERVER_FILE
3434# systemd when we are done starting up.
3535export UNITY_MIR_EMITS_SIGSTOP=1
3636
37−trap 'exit 0' USR1
37+${BINARY:-unity8} --mode=$MODE "$@" &
38+child=$!
39+
40+count=0
41+while [ $count -lt 2000 ]; do # 20 seconds
42+ sleep 0.01
43+ if [ $(ps --no-headers -o state $child) = "T" ]; then
44+ kill -CONT $child
45+ exit 0
46+ fi
47+ count=`expr $count + 1`
48+done
3849
39−(trap 'kill -CONT $$; kill -USR1 $(jobs -p)' STOP;
40− exec ${BINARY:-unity8} --mode=$MODE "$@") &
41−
42−#FIXME -- we keep hitting this timeout
43−sleep 30 # timeout for u8 startup (change to 'infinity' to disable timeout)
4450echo "Aborting unity8 launch: didn't hear back from Mir"
4551exit 100