dbus-launch(1) | General Commands Manual | dbus-launch(1) |
NAME
dbus-launch - Utility to start a message bus from a shell scriptSYNOPSIS
dbus-launch [--version] [--sh-syntax] [--csh-syntax] [--auto-syntax] [--exit-with-session] [--autolaunch=MACHINEID] [--config-file=FILENAME] [PROGRAM] [ARGS...]DESCRIPTION
The dbus-launch command is used to start a session bus instance of dbus-daemon from a shell script. It would normally be called from a user's login scripts. Unlike the daemon itself, dbus-launch exits, so backticks or the $() construct can be used to read information from dbus-launch.EXAMPLES
Distributions running dbus-launch as part of a standard X session should run dbus-launch --exit-with-session 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:
dbus-launch --exit-with-session gnome-session
dbus-launch --exit-with-session openbox
dbus-launch --exit-with-session ~/.xsession
## 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`
echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
fi
Note that in this case, dbus-launch will exit, and dbus-daemon will not be terminated automatically on logout.
AUTOMATIC LAUNCHING
If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use D-Bus, by default the process will attempt to invoke dbus-launch with the --autolaunch option to start up a new session bus or find the existing bus address on the X display or in a file in ~/.dbus/session-bus/OPTIONS
The following options are supported:- --auto-syntax
-
Choose --csh-syntax or --sh-syntax based on the SHELL environment variable.
- --close-stderr
-
Close the standard error output stream before starting the D-Bus daemon. This is useful if you want to capture dbus-launch error messages but you don't want dbus-daemon to keep the stream open to your application.
- --config-file=FILENAME
-
Pass --config-file=FILENAME to the bus daemon, instead of passing it the --session argument. See the man page for dbus-daemon
- --csh-syntax
-
Emit csh compatible code to set up environment variables.
- --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.
- --autolaunch=MACHINEID
-
This option implies that dbus-launch should scan for a previously-started session and reuse the values found there. If no session is found, it will start a new session. The --exit-with-session option is implied if --autolaunch is given. This option is for the exclusive use of libdbus, you do not want to use it manually. It may change in the future.
- --sh-syntax
-
Emit Bourne-shell compatible code to set up environment variables.
- --version
-
Print the version of dbus-launch