~didrocks/lightdm/packaging-cleanup

« back to all changes in this revision

Viewing changes to debian/lightdm-greeter-session

  • Committer: Robert Ancell
  • Date: 2013-04-30 19:12:50 UTC
  • Revision ID: robert.ancell@canonical.com-20130430191250-g7tj2exduq8bc3ri
Add packaging

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
 
3
#
 
4
# Copyright (C) 2011 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 dbus-daemon lives only as long as this
 
14
# script does.  Otherwise, it's very easy for dbus-daemon to be autolaunched
 
15
# and detached from the greeter.
 
16
 
 
17
trap cleanup TERM EXIT
 
18
 
 
19
cleanup()
 
20
{
 
21
    trap - TERM EXIT
 
22
    if [ -n "$DBUS_SESSION_BUS_PID" ]; then
 
23
        kill "$DBUS_SESSION_BUS_PID"
 
24
    fi
 
25
    if [ -n "$CMD_PID" ]; then
 
26
        kill "$CMD_PID"
 
27
    fi
 
28
    exit 0
 
29
}
 
30
 
 
31
eval `dbus-launch --sh-syntax`
 
32
 
 
33
exec $@ &
 
34
CMD_PID=$!
 
35
wait $CMD_PID
 
36
CMD_PID=