2 .\" dbus-launch manual page.
3 .\" Copyright (C) 2003 Red Hat, Inc.
7 dbus-launch \- Utility to start a message bus from a shell script
10 .B dbus-launch [\-\-version] [\-\-sh-syntax] [\-\-csh-syntax] [\-\-auto-syntax] [\-\-exit-with-session] [\-\-config-file=FILENAME] [PROGRAM] [ARGS...]
14 The \fIdbus-launch\fP command is used to start \fIdbus-daemon\fP
15 from a shell script. It would normally be called from a user's login
16 scripts. Unlike the daemon itself, \fIdbus-launch\fP exits, so
17 backticks or the $() construct can be used to read information from
20 With no arguments, \fIdbus-launch\fP will simply print the values of
21 DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID.
23 You may specify a program to be run; in this case, \fIdbus-launch\fP
24 will then set the appropriate environment variables and execute the
25 specified program, with the specified arguments. See below for
28 Finally, you may use the \-\-sh-syntax, \-\-csh-syntax, or
29 \-\-auto-syntax commands to cause \fIdbus-launch\fP to emit shell code
30 to set up the environment. This is useful in shell scripts.
32 With the \-\-auto-syntax option, \fIdbus-launch\fP looks at the value
33 of the SHELL environment variable to determine which shell syntax
34 should be used. If SHELL ends in "csh", then csh-compatible code is
35 emitted; otherwise Bourne shell code is emitted. Instead of passing
36 \-\-auto-syntax, you may explicity specify a particular one by using
37 \-\-sh-syntax for Bourne syntax, or \-\-csh-syntax for csh syntax.
38 In scripts, it's more robust to avoid \-\-auto-syntax and you hopefully
39 know which shell your script is written in.
42 See http://www.freedesktop.org/software/dbus/ for more information
43 about D-BUS. See also the man page for \fIdbus-daemon\fP.
46 Here is an example of how to use \fIdbus-launch\fP with an
47 sh-compatible shell to start the per-session bus daemon:
50 ## test for an existing bus daemon, just to be safe
51 if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
52 ## if not found, launch a new one
53 eval `dbus-launch --sh-syntax --exit-with-session`
54 echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
58 You might run something like that in your login scripts.
61 Another way to use \fIdbus-launch\fP is to run your main session
65 dbus-launch gnome-session
68 The above would likely be appropriate for ~/.xsession or ~/.Xclients.
71 The following options are supported:
74 Choose \-\-csh-syntax or \-\-sh-syntax based on the SHELL environment variable.
77 .I "--config-file=FILENAME"
78 Pass \-\-config-file=FILENAME to the bus daemon, instead of passing it
79 the \-\-session argument. See the man page for dbus-daemon
83 Emit csh compatible code to set up environment variables.
86 .I "--exit-with-session"
87 If this option is provided, a persistent "babysitter" process will be
88 created that watches stdin for HUP and tries to connect to the X
89 server. If this process gets a HUP on stdin or loses its X connection,
90 it kills the message bus daemon.
94 Emit Bourne-shell compatible code to set up environment variables.
98 Print the version of dbus-launch
101 See http://www.freedesktop.org/software/dbus/doc/AUTHORS
104 Please send bug reports to the D-BUS mailing list or bug tracker,
105 see http://www.freedesktop.org/software/dbus/