@@ -21,7 +21,9 @@ cleanup()
22 trap - TERM EXIT
22 trap - TERM EXIT
23 # Kill upstart and indicators
23 # Kill upstart and indicators
24− pkill -u lightdm -x init
24+ if [ -n "$INIT_PID" ]; then
25 if [ -n "$CMD_PID" ]; then
27 if [ -n "$CMD_PID" ]; then
26 kill "$CMD_PID"
28 kill "$CMD_PID"
@@ -55,13 +57,12 @@ fi
55# creates for them and don't want to start all the services that a normal
57# creates for them and don't want to start all the services that a normal
56# session would. So it's inconvenient to live within an upstart session.
58# session would. So it's inconvenient to live within an upstart session.
57# But... we still want to use Upstart for some services. So launch here.
59# But... we still want to use Upstart for some services. So launch here.
58−MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/init --user --startup-event=unity8-greeter-started &
60+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/init --user --no-startup-event &
59INIT_PID=$!
61INIT_PID=$!
60while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
62while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
61export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
63export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
63−export MIR_SERVER_FILE=$SUB_SOCKET
65+exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
64−exec $TOUCH_WRAPPER $@ &
66wait $CMD_PID
67wait $CMD_PID