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
commitb6fd5626fc7870c5a268f6206132741798b7254b authorMichael Terry <michael.terry@canonical.com> dateWed 9 Apr 2014, 16:07 (13 years ago) parentcc2ca60
2 files changed+10−4
data/unity8-greeter-wrapper+5−4 src/main.cpp+5
data/unity8-greeter-wrapper+5−4
@@ -21,7 +21,9 @@ cleanup()
2121{
2222 trap - TERM EXIT
2323 # Kill upstart and indicators
24− pkill -u lightdm -x init
24+ if [ -n "$INIT_PID" ]; then
25+ kill "$INIT_PID"
26+ fi
2527 if [ -n "$CMD_PID" ]; then
2628 kill "$CMD_PID"
2729 fi
@@ -55,13 +57,12 @@ fi
5557# creates for them and don't want to start all the services that a normal
5658# session would. So it's inconvenient to live within an upstart session.
5759# 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 &
5961INIT_PID=$!
6062while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
6163export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
6264
63−export MIR_SERVER_FILE=$SUB_SOCKET
64−exec $TOUCH_WRAPPER $@ &
65+exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
6566CMD_PID=$!
6667wait $CMD_PID
6768CMD_PID=
src/main.cpp+5
@@ -26,6 +26,7 @@
2626#include <qpa/qplatformnativeinterface.h>
2727#include <QLibrary>
2828#include <QDebug>
29+#include <QProcess>
2930#include <libintl.h>
3031#include <dlfcn.h>
3132#include <csignal>
@@ -130,6 +131,10 @@ int startShell(int argc, const char** argv, void* server)
130131 format.setAlphaBufferSize(8);
131132 view->setFormat(format);
132133 }
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+ }
133138#endif
134139
135140 view->setSource(source);