on xenial help sign in
Move the unity8-greeter-started upstart event into src/main.cpp where maliit will be ready to go instead of just crashing
b6fd562Michael Terry
data/unity8-greeter-wrapper+5−4
@@ -21,7 +21,9 @@ cleanup()
21{
21{
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+ kill "$INIT_PID"
26+ fi
25 if [ -n "$CMD_PID" ]; then
27 if [ -n "$CMD_PID" ]; then
26 kill "$CMD_PID"
28 kill "$CMD_PID"
27 fi
29 fi
@@ -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)
62
64
63−export MIR_SERVER_FILE=$SUB_SOCKET
65+exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
64−exec $TOUCH_WRAPPER $@ &
65CMD_PID=$!
66CMD_PID=$!
66wait $CMD_PID
67wait $CMD_PID
67CMD_PID=
68CMD_PID=
src/main.cpp+5
@@ -26,6 +26,7 @@
26#include <qpa/qplatformnativeinterface.h>
26#include <qpa/qplatformnativeinterface.h>
27#include <QLibrary>
27#include <QLibrary>
28#include <QDebug>
28#include <QDebug>
29+#include <QProcess>
29#include <libintl.h>
30#include <libintl.h>
30#include <dlfcn.h>
31#include <dlfcn.h>
31#include <csignal>
32#include <csignal>
@@ -130,6 +131,10 @@ int startShell(int argc, const char** argv, void* server)
130 format.setAlphaBufferSize(8);
131 format.setAlphaBufferSize(8);
131 view->setFormat(format);
132 view->setFormat(format);
132 }
133 }
134+
135+ if (!QProcess::startDetached("/sbin/initctl emit --no-wait unity8-greeter-started")) {
136+ qDebug() << "Unable to send unity8-greeter-started event to Upstart";
137+ }
133#endif
138#endif
134
139
135 view->setSource(source);
140 view->setSource(source);