on xenial help sign in
Install wrapper for greeter that cleans up init process for us
commit13d4d902c519be0ea966bb5e3adba77ed45efa7b authorMichael Terry <michael.terry@canonical.com> dateWed 11 Dec 2013, 14:47 (13 years ago) parentb020c52
4 files changed+39−1
CMakeLists.txt+3 debian/unity8-greeter.install+1 unity8-greeter-wrapper+34 unity8-greeter.desktop.in+1−1
CMakeLists.txt+3
@@ -203,6 +203,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop
203203install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/51-${GREETER_APP}.conf
204204 DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/lightdm.conf.d
205205 )
206+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${GREETER_APP}-wrapper
207+ DESTINATION ${CMAKE_INSTALL_BINDIR}
208+ )
206209
207210#
208211# Translation
debian/unity8-greeter.install+1
@@ -1,4 +1,5 @@
11usr/bin/unity8-greeter
2+usr/bin/unity8-greeter-wrapper
23usr/share/lightdm
34usr/share/unity8/GreeterShell.qml
45usr/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 @@
11[Desktop Entry]
22Type=Application
33Name=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
55X-LightDM-Session-Type=mir