mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
Merge pull request #22147 from keszybz/stdio-bridge-docs
More docs for systemd-stdio-bridge
This commit is contained in:
@@ -31,9 +31,23 @@
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para><command>systemd-stdio-bridge</command> may be used as a STDIO or socket-activatable
|
||||
proxy to a given D-Bus endpoint.</para>
|
||||
<para><command>systemd-stdio-bridge</command> implements a proxy for a D-Bus endpoint. It expects to
|
||||
receive an open connection to a bus when started, and will also connect to a (different) bus as a
|
||||
client. It will then act as a server on the first connection, and forward messages between the two
|
||||
busses. This program is suitable for socket activation: the first connection may be a pipe or a socket
|
||||
and must be passed as either standard input, or as an open file descriptor according to the protocol
|
||||
described in
|
||||
<citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The
|
||||
second connection will be made by default to the local system bus, but this can be influenced by the
|
||||
<option>--user</option>, <option>--system</option>, <option>--machine=</option>, and
|
||||
<option>--bus-path=</option> options described below.</para>
|
||||
|
||||
<para><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry> uses
|
||||
<command>systemd-stdio-bridge</command> to forward D-Bus connections over
|
||||
<citerefentry project='die-net'><refentrytitle>ssh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
or to connect to the bus of a different user, see
|
||||
<citerefentry><refentrytitle>sd_bus_set_address</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
@@ -42,6 +56,10 @@
|
||||
<para>The following options are understood:</para>
|
||||
|
||||
<variablelist>
|
||||
<xi:include href="user-system-options.xml" xpointer="user" />
|
||||
<xi:include href="user-system-options.xml" xpointer="system" />
|
||||
<xi:include href="user-system-options.xml" xpointer="machine" />
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-p <replaceable>PATH</replaceable></option></term>
|
||||
<term><option>--bus-path=<replaceable>PATH</replaceable></option></term>
|
||||
@@ -52,9 +70,6 @@
|
||||
|
||||
<xi:include href="standard-options.xml" xpointer="help" />
|
||||
<xi:include href="standard-options.xml" xpointer="version" />
|
||||
<xi:include href="user-system-options.xml" xpointer="user" />
|
||||
<xi:include href="user-system-options.xml" xpointer="system" />
|
||||
<xi:include href="user-system-options.xml" xpointer="machine" />
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
@@ -70,7 +85,6 @@
|
||||
<citerefentry project='dbus'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry project='dbus'><refentrytitle>dbus-broker</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<ulink url="https://www.freedesktop.org/wiki/Software/dbus">D-Bus</ulink>,
|
||||
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -250,7 +250,6 @@ conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir / 'lang
|
||||
conf.set_quoted('SYSTEMD_MAKEFS_PATH', rootlibexecdir / 'systemd-makefs')
|
||||
conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir / 'systemd-pull')
|
||||
conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir / 'systemd-shutdown')
|
||||
conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir / 'systemd-stdio-bridge')
|
||||
conf.set_quoted('SYSTEMD_TEST_DATA', testsdir / 'testdata')
|
||||
conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir / 'systemd-tty-ask-password-agent')
|
||||
conf.set_quoted('SYSTEMD_UPDATE_HELPER_PATH', rootlibexecdir / 'systemd-update-helper')
|
||||
|
||||
@@ -26,9 +26,8 @@ static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
|
||||
static bool arg_user = false;
|
||||
|
||||
static int help(void) {
|
||||
|
||||
printf("%s [OPTIONS...]\n\n"
|
||||
"STDIO or socket-activatable proxy to a given DBus endpoint.\n\n"
|
||||
"Forward messages between two D-Bus busses via a pipe or socket.\n\n"
|
||||
" -h --help Show this help\n"
|
||||
" --version Show package version\n"
|
||||
" -p --bus-path=PATH Path to the bus address (default: %s)\n"
|
||||
@@ -41,7 +40,6 @@ static int help(void) {
|
||||
}
|
||||
|
||||
static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
enum {
|
||||
ARG_VERSION = 0x100,
|
||||
ARG_MACHINE,
|
||||
@@ -64,7 +62,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
assert(argc >= 0);
|
||||
assert(argv);
|
||||
|
||||
while ((c = getopt_long(argc, argv, "hp:M:", options, NULL)) >= 0) {
|
||||
while ((c = getopt_long(argc, argv, "hp:M:", options, NULL)) >= 0)
|
||||
|
||||
switch (c) {
|
||||
|
||||
@@ -98,7 +96,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Unknown option code %c", c);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -125,7 +122,7 @@ static int run(int argc, char *argv[]) {
|
||||
in_fd = SD_LISTEN_FDS_START;
|
||||
out_fd = SD_LISTEN_FDS_START;
|
||||
} else
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Illegal number of file descriptors passed.");
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "More than one file descriptor was passed.");
|
||||
|
||||
is_unix =
|
||||
sd_is_socket(in_fd, AF_UNIX, 0, 0) > 0 &&
|
||||
|
||||
Reference in New Issue
Block a user