@@ -8,12 +8,21 @@ respawn
9pre-start script
9pre-start script
10 if [ -n "$MIR_SOCKET" ]; then
10 if [ -n "$MIR_SOCKET" ]; then
11+ if [ -z "$UNITY_MIR_SOCKET" ]; then
12+ # Save original value of MIR_SOCKET in case we are restarted,
13+ # as we modify the variable for future jobs, including ourself.
14+ UNITY_MIR_SOCKET=$MIR_SOCKET
15+ initctl set-env --global UNITY_MIR_SOCKET=$UNITY_MIR_SOCKET
11 # Point unity8 at unity-system-compositor
18 # Point unity8 at unity-system-compositor
12− initctl set-env MIR_SERVER_HOST_SOCKET=$MIR_SOCKET
13− initctl set-env MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket
19+ MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket
20+ initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE
21+ initctl set-env MIR_SERVER_HOST_SOCKET=$UNITY_MIR_SOCKET
14 # Point all future jobs in this session to our Mir socket instead of
23 # Point all future jobs in this session to our Mir socket instead of
15 # unity-system-compositor's socket.
24 # unity-system-compositor's socket.
16− initctl set-env --global MIR_SOCKET=$XDG_RUNTIME_DIR/mir_socket
25+ initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE