on xenial help sign in
Move env setup past session init in greeter wrapper. Fixes: 1325882
e04ee39Michał Sawicz
data/unity8-greeter-wrapper+10−5
@@ -32,6 +32,8 @@ cleanup()
32
32
33set_greeter_var()
33set_greeter_var()
34{
34{
35+ # Only use this after upstart has been started, otherwise multiple dbus
36+ # daemons are spawned.
35 export "$1=$2"
37 export "$1=$2"
36 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
38 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
37 if [ -n "$INIT_PID" ]; then
39 if [ -n "$INIT_PID" ]; then
@@ -52,11 +54,6 @@ fi
52# will start.
54# will start.
53export DESKTOP_SESSION=ubuntu-touch
55export DESKTOP_SESSION=ubuntu-touch
54
56
55−# We disable ofono using pulse. It causes problems with racing with the user's
56−# pulse. We need to come up with a better long-term fix for this, because we
57−# eventually need the greeter to play ringtones for users that aren't logged in.
58−set_greeter_var PA_DISABLED 1
59−
60# Normal unity8 sessions are entirely driven by Upstart. But greeters
57# Normal unity8 sessions are entirely driven by Upstart. But greeters
61# are special. They need access to the file descriptors that lightdm
58# are special. They need access to the file descriptors that lightdm
62# creates for them and don't want to start all the services that a normal
59# creates for them and don't want to start all the services that a normal
@@ -67,6 +64,14 @@ INIT_PID=$!
67while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
64while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
68export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
65export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
69
66
67+/sbin/initctl start dbus
68+export DBUS_SESSION_BUS_ADDRESS="$(/sbin/initctl get-env DBUS_SESSION_BUS_ADDRESS)"
69+
70+# We disable ofono using pulse. It causes problems with racing with the user's
71+# pulse. We need to come up with a better long-term fix for this, because we
72+# eventually need the greeter to play ringtones for users that aren't logged in.
73+set_greeter_var PA_DISABLED 1
74+
70# Start any pre-greeter tasks if needed (like wizard)
75# Start any pre-greeter tasks if needed (like wizard)
71/sbin/initctl emit unity8-greeter-starting
76/sbin/initctl emit unity8-greeter-starting
72
77