blob: f2cc03b1a45ab53d43d25b98688fe5f0ef906d7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (C) 2011 Canonical Ltd
# Author: Michael Terry <michael.terry@canonical.com>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 3 of the License.
#
# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
# This wrapper merely ensures that dbus-daemon lives only as long as this
# script does. Otherwise, it's very easy for dbus-daemon to be autolaunched
# and detached from the greeter.
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
trap cleanup TERM EXIT
cleanup()
{
trap - TERM EXIT
if [ -n "$DBUS_SESSION_BUS_PID" ]; then
kill "$DBUS_SESSION_BUS_PID"
fi
if [ -n "$CMD_PID" ]; then
kill "$CMD_PID"
fi
exit 0
}
exec dbus-run-session $@ &
CMD_PID=$!
wait $CMD_PID
CMD_PID=
|