@@ -15,23 +15,23 @@ pre-start script
1515 # Tell unity-mir to raise SIGSTOP after we start
1616 initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
1717
18− if [ -n "$MIR_SOCKET" ]; then
18+ if [ -n "$(initctl get-env --global MIR_SERVER_HOST_SOCKET)" ]; then
1919 # FIXME Create an autopilot test that makes sure start+stop and restart
2020 # work fine at least 2 times
21− # Save original value of MIR_SOCKET in case we are stopped,
21+ # Save original value of MIR_SERVER_HOST_SOCKET in case we are stopped,
2222 # as we modify the variable for future jobs, including ourself.
23− UNITY_MIR_SOCKET=$(initctl get-env --global MIR_SOCKET)
23+ UNITY_MIR_SOCKET=$(initctl get-env --global MIR_SERVER_HOST_SOCKET)
2424 initctl set-env --global UNITY_MIR_SOCKET=$UNITY_MIR_SOCKET
2525
26− # Point unity8 at unity-system-compositor
26+ # Point all future jobs in this session to our Mir socket instead of
27+ # unity-system-compositor's socket.
2728 MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket
29+ initctl set-env --global MIR_SERVER_HOST_SOCKET=$MIR_SERVER_FILE
30+ gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SERVER_HOST_SOCKET': '$MIR_SERVER_FILE'}"
31+
32+ # Point unity8 at unity-system-compositor
2833 initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE
2934 initctl set-env MIR_SERVER_HOST_SOCKET=$UNITY_MIR_SOCKET
30−
31− # Point all future jobs in this session to our Mir socket instead of
32− # unity-system-compositor's socket.
33− initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
34− gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
3535 fi
3636
3737 # Remove the normal and trusted sockets if still there
@@ -65,7 +65,7 @@ end script
6565exec ${BINARY:-unity8} --mode=$MODE $ARGS
6666
6767post-start script
68− # If no MIR_SOCKET was defined on launch, we try to set one here
68+ # If no MIR_SERVER_HOST_SOCKET was defined on launch, we try to set one here
6969 if [ -z "$(initctl get-env --global UNITY_MIR_SOCKET)" ]; then
7070 if [ -S "$XDG_RUNTIME_DIR/mir_socket" ]; then
7171 mir_socket=$XDG_RUNTIME_DIR/mir_socket
@@ -74,7 +74,7 @@ post-start script
7474 fi
7575
7676 if [ -n "$mir_socket" ]; then
77− initctl set-env --global MIR_SOCKET="$mir_socket"
77+ initctl set-env --global MIR_SERVER_HOST_SOCKET="$mir_socket"
7878 fi
7979 fi
8080
@@ -82,7 +82,7 @@ post-start script
8282end script
8383
8484post-stop script
85− initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
85+ initctl set-env --global MIR_SERVER_HOST_SOCKET=$UNITY_MIR_SOCKET
8686 initctl unset-env --global UNITY_MIR_SOCKET
8787 initctl unset-env --global MIR_SERVER_PROMPT_FILE
8888 initctl emit application-end