on b98b649 help sign in
unity8/data/unity8-greeter-wrapper
34 lines 957 B history raw
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.
11# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
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.
18trap cleanup TERM EXIT
20cleanup()
22 trap - TERM EXIT
23 # Kill upstart and indicators
24 pkill -u lightdm -x init
25 if [ -n "$CMD_PID" ]; then
26 kill "$CMD_PID"
27 fi
28 exit 0
31exec $@ &
32CMD_PID=$!
33wait $CMD_PID
34CMD_PID=