diff options
author | Alban Crequy <alban.crequy@collabora.co.uk> | 2008-09-09 18:13:39 +0100 |
---|---|---|
committer | Alban Crequy <alban.crequy@collabora.co.uk> | 2008-09-10 12:23:50 +0100 |
commit | 241d6e35c946bee2c8112f3f444fe9e2bfdaa9de (patch) | |
tree | 17131a1f408062a8960a631021117e371a7b5ead /tools/with-session-bus.sh | |
parent | 4c6d7f647f094e505f9bd19f0c9f34ebd082b060 (diff) |
with-session-bus.sh: Fork dbus-monitor if requested
If $WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor:
dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT
Diffstat (limited to 'tools/with-session-bus.sh')
-rw-r--r-- | tools/with-session-bus.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/with-session-bus.sh b/tools/with-session-bus.sh index 26d9f248a..10ddecf00 100644 --- a/tools/with-session-bus.sh +++ b/tools/with-session-bus.sh @@ -4,7 +4,7 @@ # The canonical location of this program is the telepathy-glib tools/ # directory, please synchronize any changes with that copy. # -# Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/> +# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/> # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -20,6 +20,8 @@ usage () { echo "usage: $me [options] -- program [program_options]" >&2 echo "Requires write access to the current directory." >&2 + echo "If \$WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor:" >&2 + echo " dbus-monitor \$WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2 exit 2 } @@ -65,6 +67,13 @@ dbus-daemon $dbus_daemon_args e=0 DBUS_SESSION_BUS_ADDRESS="`cat $me-$$.address`" export DBUS_SESSION_BUS_ADDRESS + +if [ -n "$WITH_SESSION_BUS_FORK_DBUS_MONITOR" ] ; then + echo -n "Forking dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2 + dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT \ + &> $me-$$.dbus-monitor-logs & +fi + "$@" || e=$? trap - INT HUP TERM |