dbus\-launch \- Utility to start a message bus from a shell script
.SH SYNOPSIS
.PP
-.B dbus\-launch [\-\-version] [\-\-sh\-syntax] [\-\-csh\-syntax] [\-\-auto\-syntax] [\-\-exit\-with\-session] [\-\-exit\-with\-x11] [\-\-autolaunch=MACHINEID] [\-\-config\-file=FILENAME] [PROGRAM] [ARGS...]
+.B dbus\-launch [\-\-version] [\-\-sh\-syntax] [\-\-csh\-syntax] [\-\-auto\-syntax] [\-\-exit\-with\-session] [\-\-autolaunch=MACHINEID] [\-\-config\-file=FILENAME] [PROGRAM] [ARGS...]
.SH DESCRIPTION
See http://www.freedesktop.org/software/dbus/ for more information
about D\-Bus. See also the man page for \fIdbus\-daemon\fP.
-.PP
-Here is an example of how to use \fIdbus\-launch\fP with an
-sh\-compatible shell to start the per\-session bus daemon:
-.nf
+.SH EXAMPLES
+
+Distributions running
+.B dbus\-launch
+as part of a standard X session should run
+.B "dbus\-launch \-\-exit\-with\-x11"
+after the X server has started and become available, as a wrapper around
+the "main" X client (typically a session manager or window manager), as in
+these examples:
+
+.RS
+.B "dbus\-launch \-\-exit\-with\-x11 gnome\-session"
+
+.B "dbus\-launch \-\-exit\-with\-x11 openbox"
+.B "dbus\-launch \-\-exit\-with\-x11 ~/.xsession"
+.RE
+
+If your distribution does not do this, you can achieve similar results
+by running your session or window manager in the same way in a script
+run by your X session, such as
+.BR ~/.xsession ,
+.B ~/.xinitrc
+or
+.BR ~/.Xclients .
+
+To start a D-Bus session within a text-mode session, you can run
+dbus-launch in the background. For instance, in a sh-compatible shell:
+
+.nf
## test for an existing bus daemon, just to be safe
if test \-z "$DBUS_SESSION_BUS_ADDRESS" ; then
## if not found, launch a new one
- eval `dbus\-launch \-\-sh\-syntax \-\-exit\-with\-session`
+ eval `dbus\-launch \-\-sh\-syntax`
echo "D\-Bus per\-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
fi
-
.fi
-You might run something like that in your login scripts.
-
-.PP
-Another way to use \fIdbus\-launch\fP is to run your main session
-program, like so:
-.nf
-
-dbus\-launch gnome\-session
-
-.fi
-The above would likely be appropriate for ~/.xsession or ~/.Xclients.
+Note that in this case, dbus-launch will exit, and dbus-daemon will not be
+terminated automatically on logout.
.SH AUTOMATIC LAUNCHING
Emit csh compatible code to set up environment variables.
.TP
-.I \-\-exit\-with\-x11
-If this option is provided, a persistent "babysitter" process will be
-created, and will connect to the X server. If it cannot do so, launching
-fails. If the "babysitter" process loses its X connection,
-it kills the message bus daemon, disconnecting all of its clients (which
-should exit in response). This avoids having leftover daemon
-processes from a user X session, after the X session has ended.
-
-.TP
-.I \-\-exit\-with\-session
-If this option is provided, a persistent "babysitter" process will be
-created, as if for
-.BR \-\-exit\-with\-x11 .
-If it cannot connect to the X server, it will monitor the terminal from which
-.B dbus-launch
-was started instead, and if it gets a HUP on stdin, the message bus daemon
-will be killed. This option is not recommended, since it will consume input
-from the terminal where it was started; it is mainly provided for
-backwards compatibility.
+.I "\-\-exit\-with\-session"
+If this option is provided, a persistent "babysitter" process will be
+created that watches stdin for HUP and tries to connect to the X
+server. If this process gets a HUP on stdin or loses its X connection,
+it kills the message bus daemon.
.TP
.I "\-\-autolaunch=MACHINEID"
.I "\-\-version"
Print the version of dbus\-launch
+.SH NOTES
+
+If you run
+.B "dbus\-launch myapp"
+(with any other options), dbus\-daemon will
+.I not
+exit when
+.B myapp
+terminates: this is because
+.B myapp
+is assumed to be part of a larger session, rather than a session in its
+own right.
+
.SH AUTHOR
See http://www.freedesktop.org/software/dbus/doc/AUTHORS