@@ -8,12 +8,21 @@ respawn
88
99pre-start script
1010 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
16+ fi
17+
1118 # 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
22+
1423 # Point all future jobs in this session to our Mir socket instead of
1524 # 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
1726 fi
1827end script
1928