@@ -12,6 +12,9 @@ respawn
1212expect stop
1313
1414pre-start script
15+ # Tell unity-mir to raise SIGSTOP after we quit
16+ initctl set-env UNITY_MIR_EXPECTS_SIGSTOP=1
17+
1518 if [ -n "$MIR_SOCKET" ]; then
1619 if [ -z "$UNITY_MIR_SOCKET" ]; then
1720 # Save original value of MIR_SOCKET in case we are restarted,
@@ -45,3 +48,9 @@ pre-start script
4548end script
4649
4750exec ${BINARY:-unity8} $ARGS
51+
52+post-stop script
53+ initctl unset-env UNITY_MIR_EXPECTS_SIGSTOP
54+ initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
55+ initctl unset-env --global UNITY_MIR_SOCKET
56+end script