on xenial help sign in
Install wrapper for greeter that cleans up init process for us
13d4d90Michael Terry
CMakeLists.txt+3
@@ -203,6 +203,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop
203install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/51-${GREETER_APP}.conf
203install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/51-${GREETER_APP}.conf
204 DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/lightdm.conf.d
204 DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/lightdm.conf.d
205 )
205 )
206+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${GREETER_APP}-wrapper
207+ DESTINATION ${CMAKE_INSTALL_BINDIR}
208+ )
206
209
207#
210#
208# Translation
211# Translation
debian/unity8-greeter.install+1
@@ -1,4 +1,5 @@
1usr/bin/unity8-greeter
1usr/bin/unity8-greeter
2+usr/bin/unity8-greeter-wrapper
2usr/share/lightdm
3usr/share/lightdm
3usr/share/unity8/GreeterShell.qml
4usr/share/unity8/GreeterShell.qml
4usr/share/unity8/Greeter
5usr/share/unity8/Greeter
unity8-greeter-wrappernew file+34
@@ -0,0 +1,34 @@
1+#!/bin/sh
2+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
3+#
4+# Copyright (C) 2011,2013 Canonical Ltd
5+# Author: Michael Terry <michael.terry@canonical.com>
6+#
7+# This program is free software: you can redistribute it and/or modify it under
8+# the terms of the GNU General Public License as published by the Free Software
9+# Foundation, version 3 of the License.
10+#
11+# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
12+
13+# This wrapper merely ensures that init and friends live only as long as this
14+# script does. Otherwise, it's very easy for some processes to not notice that
15+# the session died. We could try to do this in-process, but we want to do this
16+# cleanup even if the greeter aborts.
17+
18+trap cleanup TERM EXIT
19+
20+cleanup()
21+{
22+ trap - TERM EXIT
23+ # Kill upstart and indicators
24+ killall -u lightdm /sbin/init
25+ if [ -n "$CMD_PID" ]; then
26+ kill "$CMD_PID"
27+ fi
28+ exit 0
29+}
30+
31+exec $@ &
32+CMD_PID=$!
33+wait $CMD_PID
34+CMD_PID=
unity8-greeter.desktop.in+1−1
@@ -1,5 +1,5 @@
1[Desktop Entry]
1[Desktop Entry]
2Type=Application
2Type=Application
3Name=Unity 8 Greeter
3Name=Unity 8 Greeter
4−Exec=ubuntu-touch-session dbus-launch @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-greeter
4+Exec=ubuntu-touch-session @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-greeter-wrapper @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-greeter
5X-LightDM-Session-Type=mir
5X-LightDM-Session-Type=mir