2003-05-04 03:22:46 +00:00
|
|
|
.\"
|
|
|
|
|
.\" dbus-launch manual page.
|
|
|
|
|
.\" Copyright (C) 2003 Red Hat, Inc.
|
|
|
|
|
.\"
|
|
|
|
|
.TH dbus-launch 1
|
|
|
|
|
.SH NAME
|
|
|
|
|
dbus-launch \- Utility to start a message bus from a shell script
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.PP
|
2003-10-12 05:59:39 +00:00
|
|
|
.B dbus-launch [\-\-version] [\-\-sh-syntax] [\-\-csh-syntax] [\-\-auto-syntax] [\-\-exit-with-session] [\-\-config-file=FILENAME] [PROGRAM] [ARGS...]
|
2003-05-04 03:22:46 +00:00
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
2005-01-18 22:20:38 +00:00
|
|
|
The \fIdbus-launch\fP command is used to start \fIdbus-daemon\fP
|
2003-05-04 03:22:46 +00:00
|
|
|
from a shell script. It would normally be called from a user's login
|
|
|
|
|
scripts. Unlike the daemon itself, \fIdbus-launch\fP exits, so
|
|
|
|
|
backticks or the $() construct can be used to read information from
|
2003-05-18 02:39:47 +00:00
|
|
|
\fIdbus-launch\fP.
|
|
|
|
|
|
|
|
|
|
With no arguments, \fIdbus-launch\fP will simply print the values of
|
|
|
|
|
DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID.
|
|
|
|
|
|
|
|
|
|
You may specify a program to be run; in this case, \fIdbus-launch\fP
|
|
|
|
|
will then set the appropriate environment variables and execute the
|
|
|
|
|
specified program, with the specified arguments. See below for
|
|
|
|
|
examples.
|
|
|
|
|
|
2003-10-12 05:59:39 +00:00
|
|
|
Finally, you may use the \-\-sh-syntax, \-\-csh-syntax, or
|
|
|
|
|
\-\-auto-syntax commands to cause \fIdbus-launch\fP to emit shell code
|
|
|
|
|
to set up the environment. This is useful in shell scripts.
|
|
|
|
|
|
|
|
|
|
With the \-\-auto-syntax option, \fIdbus-launch\fP looks at the value
|
|
|
|
|
of the SHELL environment variable to determine which shell syntax
|
|
|
|
|
should be used. If SHELL ends in "csh", then csh-compatible code is
|
|
|
|
|
emitted; otherwise Bourne shell code is emitted. Instead of passing
|
|
|
|
|
\-\-auto-syntax, you may explicity specify a particular one by using
|
|
|
|
|
\-\-sh-syntax for Bourne syntax, or \-\-csh-syntax for csh syntax.
|
|
|
|
|
In scripts, it's more robust to avoid \-\-auto-syntax and you hopefully
|
|
|
|
|
know which shell your script is written in.
|
2003-05-04 03:22:46 +00:00
|
|
|
|
|
|
|
|
.PP
|
|
|
|
|
See http://www.freedesktop.org/software/dbus/ for more information
|
2005-01-18 22:20:38 +00:00
|
|
|
about D-BUS. See also the man page for \fIdbus-daemon\fP.
|
2003-05-04 03:22:46 +00:00
|
|
|
|
|
|
|
|
.PP
|
|
|
|
|
Here is an example of how to use \fIdbus-launch\fP with an
|
2003-05-04 08:54:24 +00:00
|
|
|
sh-compatible shell to start the per-session bus daemon:
|
2003-05-04 03:22:46 +00:00
|
|
|
.nf
|
|
|
|
|
|
2003-05-04 08:54:24 +00:00
|
|
|
## 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
|
2003-10-12 05:59:39 +00:00
|
|
|
eval `dbus-launch --sh-syntax --exit-with-session`
|
2003-05-04 08:54:24 +00:00
|
|
|
echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
|
|
|
|
|
fi
|
2003-05-04 03:22:46 +00:00
|
|
|
|
|
|
|
|
.fi
|
2003-05-04 08:54:24 +00:00
|
|
|
You might run something like that in your login scripts.
|
2003-05-04 03:22:46 +00:00
|
|
|
|
2003-05-18 02:39:47 +00:00
|
|
|
.PP
|
|
|
|
|
Another way to use \fIdbus-launch\fP is to run your main session
|
|
|
|
|
program, like so:
|
|
|
|
|
.nf
|
|
|
|
|
|
|
|
|
|
dbus-launch gnome-session
|
|
|
|
|
|
|
|
|
|
.fi
|
2003-10-12 05:59:39 +00:00
|
|
|
The above would likely be appropriate for ~/.xsession or ~/.Xclients.
|
2003-05-18 02:39:47 +00:00
|
|
|
|
2003-05-04 03:22:46 +00:00
|
|
|
.SH OPTIONS
|
|
|
|
|
The following options are supported:
|
2003-05-18 02:39:47 +00:00
|
|
|
.TP
|
|
|
|
|
.I "--auto-syntax"
|
2003-10-12 05:59:39 +00:00
|
|
|
Choose \-\-csh-syntax or \-\-sh-syntax based on the SHELL environment variable.
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.I "--config-file=FILENAME"
|
|
|
|
|
Pass \-\-config-file=FILENAME to the bus daemon, instead of passing it
|
2005-01-18 22:20:38 +00:00
|
|
|
the \-\-session argument. See the man page for dbus-daemon
|
2003-05-18 02:39:47 +00:00
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
.I "--csh-syntax"
|
2003-10-12 05:59:39 +00:00
|
|
|
Emit csh compatible code to set up environment variables.
|
2003-05-18 02:39:47 +00:00
|
|
|
|
2003-05-04 03:22:46 +00:00
|
|
|
.TP
|
|
|
|
|
.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.
|
|
|
|
|
|
2003-05-18 02:39:47 +00:00
|
|
|
.TP
|
|
|
|
|
.I "--sh-syntax"
|
2003-10-12 05:59:39 +00:00
|
|
|
Emit Bourne-shell compatible code to set up environment variables.
|
2003-05-18 02:39:47 +00:00
|
|
|
|
2003-05-04 03:22:46 +00:00
|
|
|
.TP
|
|
|
|
|
.I "--version"
|
|
|
|
|
Print the version of dbus-launch
|
|
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
See http://www.freedesktop.org/software/dbus/doc/AUTHORS
|
|
|
|
|
|
|
|
|
|
.SH BUGS
|
|
|
|
|
Please send bug reports to the D-BUS mailing list or bug tracker,
|
|
|
|
|
see http://www.freedesktop.org/software/dbus/
|