Compare commits

..

No commits in common. "09f87228011cb763c3c0a94193d3f4eb0c6cc23b" and "1cabd2d0c56b7de73e4a4fb645f3bbed4a528d2c" have entirely different histories.

35 changed files with 327 additions and 7435 deletions

3
TODO
View File

@ -4,9 +4,6 @@ Bugfixes:
manager or system manager can be always set. It would be better to reject manager or system manager can be always set. It would be better to reject
them when parsing config. them when parsing config.
* busctl prints errors to stdout:
busctl tree org.freedesktop.systemd1 /org/freedesktop/systemd1
External: External:
* Fedora: add an rpmlint check that verifies that all unit files in the RPM are listed in %systemd_post macros. * Fedora: add an rpmlint check that verifies that all unit files in the RPM are listed in %systemd_post macros.

View File

@ -6,7 +6,6 @@
<!ENTITY systemenvgeneratordir @SYSTEM_ENV_GENERATOR_DIR@> <!ENTITY systemenvgeneratordir @SYSTEM_ENV_GENERATOR_DIR@>
<!ENTITY userenvgeneratordir @USER_ENV_GENERATOR_DIR@> <!ENTITY userenvgeneratordir @USER_ENV_GENERATOR_DIR@>
<!ENTITY CERTIFICATE_ROOT @CERTIFICATE_ROOT@> <!ENTITY CERTIFICATE_ROOT @CERTIFICATE_ROOT@>
<!ENTITY FALLBACK_HOSTNAME @FALLBACK_HOSTNAME@>
<!ENTITY MEMORY_ACCOUNTING_DEFAULT @MEMORY_ACCOUNTING_DEFAULT_YES_NO@> <!ENTITY MEMORY_ACCOUNTING_DEFAULT @MEMORY_ACCOUNTING_DEFAULT_YES_NO@>
<!ENTITY KILL_USER_PROCESSES @KILL_USER_PROCESSES_YES_NO@> <!ENTITY KILL_USER_PROCESSES @KILL_USER_PROCESSES_YES_NO@>
<!ENTITY DEBUGTTY @DEBUGTTY@> <!ENTITY DEBUGTTY @DEBUGTTY@>

View File

@ -1,285 +0,0 @@
<?xml version="1.0"?>
<!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "custom-entities.ent" >
%entities;
]>
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.hostname1" conditional='ENABLE_HOSTNAMED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.hostname1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.hostname1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.hostname1</refname>
<refpurpose>The D-Bus interface of systemd-hostnamed</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that can be used to control the hostname and related machine metadata from user
programs. This page describes the hostname semantics and the D-Bus interface.</para>
</refsect1>
<refsect1>
<title>The D-Bus API</title>
<para>The service exposes the following interfaces on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.hostname1 \
--object-path /org/freedesktop/hostname1
node /org/freedesktop/hostname1 {
interface org.freedesktop.hostname1 {
methods:
SetHostname(in s hostname,
in b interactive);
SetStaticHostname(in s hostname,
in b interactive);
SetPrettyHostname(in s hostname,
in b interactive);
SetIconName(in s icon,
in b interactive);
SetChassis(in s chassis,
in b interactive);
SetDeployment(in s deployment,
in b interactive);
SetLocation(in s location,
in b interactive);
GetProductUUID(in b interactive,
out ay uuid);
properties:
readonly s Hostname = '...';
readonly s StaticHostname = '...';
readonly s PrettyHostname = '...';
readonly s IconName = '...';
readonly s Chassis = '...';
readonly s Deployment = '...';
readonly s Location = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s KernelName = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s KernelRelease = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s KernelVersion = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s OperatingSystemPrettyName = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s OperatingSystemCPEName = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HomeURL = '...';
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--method SetDeployment is not documented!-->
<!--method SetLocation is not documented!-->
<!--method GetProductUUID is not documented!-->
<!--property Hostname is not documented!-->
<!--property StaticHostname is not documented!-->
<!--property PrettyHostname is not documented!-->
<!--property IconName is not documented!-->
<!--property Chassis is not documented!-->
<!--property Deployment is not documented!-->
<!--property Location is not documented!-->
<!--property KernelName is not documented!-->
<!--property KernelRelease is not documented!-->
<!--property KernelVersion is not documented!-->
<!--property OperatingSystemPrettyName is not documented!-->
<!--property OperatingSystemCPEName is not documented!-->
<!--property HomeURL is not documented!-->
<para>Whenever the hostname or other metadata is changed via the daemon,
<function>PropertyChanged</function> signals are sent out to subscribed clients. Changing a hostname
using this interface is authenticated via PolicyKit.</para>
</refsect1>
<refsect1>
<title>Semantics</title>
<para>The <emphasis>static (configured) hostname</emphasis> is the one configured in
<filename>/etc/hostname</filename>. It is chosen by the local user. It is not always in sync with the
current hostname as returned by the
<citerefentry project="man-pages"><refentrytitle>gethostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>
system call. If no hostname is configured this property will be the empty string. Setting this property
to the empty string will remove <filename>/etc/hostname</filename>. This property should be an
internet-style hostname, 7-bit lowercase ASCII, no special chars/spaces.</para>
<para>The <emphasis>transient (dynamic) hostname</emphasis> is the one configured via the kernel's
<citerefentry project="man-pages"><refentrytitle>sethostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
It can be different from the static hostname if DHCP or mDNS have been configured to change the name
based on network information. <!-- FIXME: it's not DHCP that configures this... -->
This property is never empty. If no hostname is set this will default to
<literal>&FALLBACK_HOSTNAME;</literal> (configurable at compilation time). Setting this property to the
empty string will reset the dynamic hostname to the static hostname. If no static hostname is
configured the dynamic hostname will be reset to <literal>&FALLBACK_HOSTNAME;</literal>. This property
should be an internet-style hostname, 7-bit lowercase ASCII, no special chars/spaces.</para>
<para>The <emphasis>pretty hostname</emphasis> is a free-form UTF-8 hostname for presentation to the
user. User interfaces should ensure that the pretty hostname and the static hostname stay in sync.
I.e. when the former is <literal>Lennarts Computer</literal> the latter should be
<literal>lennarts-computer</literal>. If no pretty hostname is set this setting will be the empty
string. Applications should then find a suitable fallback, such as the dynamic hostname.</para>
<para>The <emphasis>icon name</emphasis> is a name following the XDG icon naming spec. If not set,
information such as the chassis type (see below) is used to find a suitable fallback icon name
(i.e. <literal>computer-laptop</literal> vs. <literal>computer-desktop</literal> is picked based on the
chassis information). If no such data is available, the empty string is returned. In that case an application
should fall back to a replacement icon, for example <literal>computer</literal>. If this property is set
to the empty string, the automatic fallback name selection is enabled again.</para>
<para>The <emphasis>chassis type</emphasis> should be one of the currently defined chassis types:
<literal>desktop</literal>, <literal>laptop</literal>, <literal>server</literal>,
<literal>tablet</literal>, <literal>handset</literal>, as well as the special chassis types
<literal>vm</literal> and <literal>container</literal> for virtualized systems. Note that in most cases
the chassis type will be determined automatically from DMI/SMBIOS/ACPI firmware information. Writing to
this setting is hence useful only to override misdetected chassis types, or to configure the chassis type if
it could not be auto-detected. Set this property to the empty string to reenable the automatic detection of
the chassis type from firmware information.</para>
<para>A client that wants to change the local hostname for DHCP/mDNS should invoke
<code>SetHostname("newname", false)</code> as soon as the name is available and afterwards reset it via
<code>SetHostname("")</code>.</para>
<para>Note that <filename>systemd-hostnamed</filename> starts only on request and terminates after a
short idle period. This effectively means that <function>PropertyChanged</function> messages are not sent
out for changes made directly on the files (as in: administrator edits the files with vi). This is
the intended behavior: manual configuration changes should require manual reloading.</para>
<para>The transient (dynamic) hostname maps directly to the kernel hostname. This hostname should be
assumed to be highly dynamic, and hence should be watched directly, without depending on
<function>PropertyChanged</function> messages from <filename>systemd-hostnamed</filename>. To accomplish
this, open <filename>/proc/sys/kernel/hostname</filename> and
<citerefentry project="man-pages"><refentrytitle>poll</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for <constant>SIGHUP</constant> which is triggered by the kernel every time the hostname changes. Again:
this is special for the transient (dynamic) hostname, and does not apply to the configured (fixed)
hostname.</para>
<para>Applications may read the hostname data directly if hostname change notifications
are not necessary. Use
<citerefentry project="man-pages"><refentrytitle>gethostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<filename>/etc/hostname</filename> (possibly with per-distribution fallbacks), and
<citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for that. For more information on these files and syscalls see the respective man pages.</para>
<para>The <varname>user_interaction</varname> boolean parameters can be used to control whether PolicyKit
should interactively ask the user for authentication credentials if required.</para>
<para>The PolicyKit action for <function>SetHostname()</function> is
<interfacename>org.freedesktop.hostname1.set-hostname</interfacename>. For
<function>SetStaticHostname()</function> and <function>SetPrettyHostname()</function> it is
<interfacename>org.freedesktop.hostname1.set-static-hostname</interfacename>. For
<function>SetIconName()</function> and <function>SetChassis()</function> it is
<interfacename>org.freedesktop.hostname1.set-machine-info</interfacename>.</para>
<para>Here are three examples show how the pretty hostname and the icon name should be used:
<itemizedlist>
<listitem><para>When registering DNS-SD services: use the pretty hostname in the service name, and
pass the icon name in the TXT data, if there is an icon name. Browsing clients can then show the server
icon on each service. This is especially useful for WebDAV applications or UPnP media sharing.
</para></listitem>
<listitem><para>Set the bluetooth name to the pretty hostname.</para></listitem>
<listitem><para>When your file browser has a "Computer" icon, replace the name with the pretty hostname if set, and the icon with the icon name, if it is set.</para></listitem>
</itemizedlist></para>
<para>To properly handle name lookups with changing local hostnames without having to edit
<filename>/etc/hosts</filename>, we recommend using <filename>systemd-hostnamed</filename> in
combination with <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para>Here are some recommendations to follow when generating a static (internet) hostname from a pretty
name:
<itemizedlist>
<listitem><para>Generate a single DNS label only, not an FQDN. That means no dots allowed. Strip them,
or replace them with <literal>-</literal>.</para></listitem>
<listitem><para>It's probably safer to not use any non-ASCII chars, even if DNS allows this in some way
these days. In fact, restrict your charset to <literal>a-zA-Z0-9</literal> and <literal>-</literal>.
Strip other chars, or try to replace them in some smart way with chars from this set, for example
<literal>ä</literal><literal>ae</literal>, and use <literal>-</literal> as the replacement for all
punctuation characters and whitespace.</para></listitem>
<listitem><para>Try to avoid creating repeated <literal>-</literal>, as well as <literal>-</literal> as
the first or last char.</para></listitem>
<listitem><para>Limit the hostname to 63 chars, which is the length of a DNS label.</para></listitem>
<listitem><para>If after stripping special chars the empty string is the result, you can pass this
as-is to <filename>systemd-hostnamed</filename> in which case it will automatically use
<literal>&FALLBACK_HOSTNAME;</literal>.</para></listitem>
<listitem><para>Uppercase charaacters should be replaced with their lowercase equivalents.
</para></listitem>
</itemizedlist></para>
<para>Note that while <filename>systemd-hostnamed</filename> applies some checks to the hostname you pass
they are much looser than the recommendations above. For example, <filename>systemd-hostnamed</filename>
will also accept <literal>_</literal> in the hostname, but we recommend not using this to avoid clashes
with DNS-SD service types. Also <filename>systemd-hostnamed</filename> allows longer hostnames, but
because of the DNS label limitations, we recommend not making use of this.</para>
<para>Here are a couple of example conversions:
<itemizedlist>
<listitem><para><literal>Lennart's PC</literal><literal>lennarts-pc</literal></para></listitem>
<listitem><para><literal>Müllers Computer</literal><literal>muellers-computer</literal></para></listitem>
<listitem><para><literal>Voran!</literal><literal>voran</literal></para></listitem>
<listitem><para><literal>Es war einmal ein Männlein</literal><literal>es-war-einmal-ein-maennlein</literal></para></listitem>
<listitem><para><literal>Jawoll. Ist doch wahr!</literal><literal>jawoll-ist-doch-wahr</literal></para></listitem>
<listitem><para><literal>レナート</literal><literal>localhost</literal></para></listitem>
<listitem><para><literal>...zack!!! zack!...</literal><literal>zack-zack</literal></para></listitem>
</itemizedlist></para>
<para>Of course, an already valid internet hostname label you enter and pass through this
conversion should stay unmodified, so that users have direct control of it, if they want -- by simply
ignoring the fact that the pretty hostname is pretty and just edit it as if it was the normal internet
name.</para>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
<refsect1>
<title>See also</title>
<para>David Zeuthen's original Fedora
<ulink url="https://fedoraproject.org/wiki/Features/BetterHostname">Feature page about xdg-hostname</ulink></para>
</refsect1>
</refentry>

View File

@ -1,280 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.import1" conditional='ENABLE_IMPORTD'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.import1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.import1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.import1</refname>
<refpurpose>The D-Bus interface of systemd-importd</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-importd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service which may be used to import, export and download additional system images. These
images can be used by tools such as
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
to run local containers. The service is used as the backend for <command>machinectl pull-raw</command>,
<command>machinectl pull-tar</command> and related commands. This page describes the D-Bus interface.
</para>
<para>Note that
<citerefentry><refentrytitle>systemd-importd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is mostly a small companion service for
<citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Many operations to manipulate local container and VM images are hence available via the <command>systemd-machined</command> D-Bus API, c.f.
<citerefentry><refentrytitle>org.freedesktop.machine1.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1>
<title>The Manager Object</title>
<para>The service exposes the following interfaces on the Manager object on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.import1 \
--object-path /org/freedesktop/import1
node /org/freedesktop/import1 {
interface org.freedesktop.import1.Manager {
methods:
ImportTar(in h fd,
in s local_name,
in b force,
in b read_only,
out u transfer_id,
out o transfer_path);
ImportRaw(in h fd,
in s local_name,
in b force,
in b read_only,
out u transfer_id,
out o transfer_path);
ImportFileSystem(in h fd,
in s local_name,
in b force,
in b read_only,
out u transfer_id,
out o transfer_path);
ExportTar(in s local_name,
in h fd,
in s format,
out u transfer_id,
out o transfer_path);
ExportRaw(in s local_name,
in h fd,
in s format,
out u transfer_id,
out o transfer_path);
PullTar(in s url,
in s local_name,
in s verify_mode,
in b force,
out u transfer_id,
out o transfer_path);
PullRaw(in s url,
in s local_name,
in s verify_mode,
in b force,
out u transfer_id,
out o transfer_path);
ListTransfers(out a(usssdo) transfers);
CancelTransfer(in u transfer_id);
signals:
TransferNew(u transfer_id,
o transfer_path);
TransferRemoved(u transfer_id,
o transfer_path,
s result);
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--method ImportFileSystem is not documented!-->
<refsect2>
<title>Methods</title>
<para><function>ImportTar()</function> and <function>ImportRaw()</function> import a system image and
place it into <filename>/var/lib/machines/</filename>. The first argument should be a file descriptor
(opened for reading) referring to the tar or raw file to import. It should reference a file on disk,
a pipe or a socket. When <function>ImportTar()</function> is used the file descriptor should
refer to a tar file, optionally compressed with
<citerefentry project="die-net"><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry project="die-net"><refentrytitle>bzip2</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
or
<citerefentry project="die-net"><refentrytitle>xz</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
<command>systemd-importd</command> will detect the used compression scheme (if any) automatically. When
<function>ImportRaw()</function> is used the file descriptor should refer to a raw or qcow2 disk image
containing an MBR or GPT disk label, also optionally compressed with gzip, bzip2 or xz. In either case,
if the file is specified as a file descriptor on disk, progress information is generated for the import
operation (as in that case we know the total size on disk). If a socket or pipe is specified, progress information is not
available. The file descriptor argument is followed by a local name for the image. This should be a
name suitable as a hostname and will be used to name the imported image below
<filename>/var/lib/machines</filename>. A tar import is placed as a directory tree or a
<citerefentry project="man-pages"><refentrytitle>btrfs</refentrytitle><manvolnum>8</manvolnum></citerefentry>
subvolume below <filename>/var/lib/machines/</filename> under the specified name with no suffix
appended. A raw import is placed as a file in <filename>/var/lib/machines/</filename> with the
<filename>.raw</filename> suffix appended. If the <option>force</option> argument is true, any
pre-existing image with the same name is removed before starting the operation. Otherwise, the
operation fails if an image with the same name already exists. Finally, the
<option>read_only</option> argument controls
whether to create a writable or read-only image. Both methods return immediately after starting the import,
with the import transfer ongoing. They return a pair of transfer identifier and object path, which may
be used to retrieve progress information about the transfer or to cancel it. The transfer identifier is a
simple numeric identifier, the object path references an
<interfacename>org.freedesktop.import1.Transfer</interfacename> object, see below. Listen for a
<function>TransferRemoved</function> signal for the transfer ID in order to detect when a transfer is
complete. The returned transfer object is useful to determine the current progress or log output of the
ongoing import operation.</para>
<para><function>ExportTar()</function> and <function>ExportRaw()</function> implement the reverse
operation, and may be used to export a system image in order to place it in a tar or raw image. They
take the machine name to export as their first parameter, followed by a file descriptor (opened for writing)
where the tar or raw file will be written. It may either reference a file on disk or a pipe/socket. The
third argument specifies in which compression format to write the image. It takes one of
<literal>uncompressed</literal>, <literal>xz</literal>, <literal>bzip2</literal> or
<literal>gzip</literal>, depending on which compression scheme is required. The image written to the
specified file descriptor will be a tar file in case of <function>ExportTar()</function> or a raw disk
image in case of <function>ExportRaw()</function>. Note that currently raw disk images may not be
exported as tar files, and vice versa. This restriction might be lifted eventually. The call
returns a transfer identifier and object path for cancelling or tracking the export operation, similar
to <function>ImportTar()</function> or <function>ImportRaw()</function> as described above.</para>
<para><function>PullTar()</function> and <function>PullRaw()</function> may be used to download, verify
and import a system image from a URL. They take an URL argument which should point to a tar or
raw file on the <literal>http://</literal> or <literal>https://</literal> protocols, possibly
compressed with xz, bzip2 or gzip. The second argument is a local name for the image. It should be
suitable as a hostname, similar to the matching argument of the <function>ImportTar()</function> and
<function>ImportRaw()</function> methods above. The third argument indicates the verification mode for
the image. It may be one of <literal>no</literal>, <literal>checksum</literal>,
<literal>signature</literal>. <literal>no</literal> turns off any kind of verification of the image;
<literal>checksum</literal> looks for a <filename>SHA256SUM</filename> file next to the downloaded
image and verifies any SHA256 hash value in that file against the image; <literal>signature</literal>
does the same but also tries to authenticate the <filename>SHA256SUM</filename> file via
<citerefentry project="man-pages"><refentrytitle>gpg</refentrytitle><manvolnum>8</manvolnum></citerefentry>
first. The last argument indicates whether to replace a possibly pre-existing image with the same local
name (if <literal>true</literal>), or whether to fail (if <literal>false</literal>). Like the import
and export calls above, these calls return a pair of transfer identifier and object path for the ongoing
download.</para>
<para><function>ListTransfers()</function> returns a list of ongoing import, export or download
operations as created with the six calls described above. It returns an array of structures which
consist of the numeric transfer identifier, a string indicating the operation (one of
<literal>import-tar</literal>, <literal>import-raw</literal>, <literal>export-tar</literal>,
<literal>export-raw</literal>, <literal>pull-tar</literal> or <literal>pull-raw</literal>), a string
describing the remote file (in case of download operations this is the source URL, in case of
import/export operations this is a short string describing the file descriptor passed in), a string
with the local machine image name, a progress value between 0.0 (for 0%) and 1.0 (for 100%), as well as
the transfer object path.</para>
<para><function>CancelTransfer()</function> may be used to cancel an ongoing import, export or download
operation. Simply specify the transfer identifier to cancel the ongoing operation.</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>The <function>TransferNew</function> signal is generated each time a new transfer is started with
the import, export or download calls described above. It carries the transfer ID and object path that
have just been created.</para>
<para>The <function>TransferRemoved</function> signal is sent each time a transfer finishes,
is canceled or fails. It also carries the transfer ID and object path, followed by a string indicating
the result of the operation, which is one of <literal>done</literal> (on success),
<literal>canceled</literal> or <literal>failed</literal>.</para>
</refsect2>
</refsect1>
<refsect1>
<title>The Transfer Object</title>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.import1 \
--object-path /org/freedesktop/import1/transfer/_1
node /org/freedesktop/import1/transfer/_1 {
interface org.freedesktop.import1.Transfer {
methods:
Cancel();
signals:
LogMessage(u priority,
s line);
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u Id = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Local = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Remote = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Type = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Verify = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly d Progress = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--signal LogMessage is not documented!-->
<refsect2>
<title>Methods</title>
<para>The <function>Cancel()</function> method may be used to cancel the transfer. It takes no
parameters. This call is pretty much equivalent to the <function>CancelTransfer()</function> call on
the <structname>Manager</structname> interface (see above), but is exposed on the
<structname>Transfer</structname> object itself instead of taking a transfer ID.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para>The <varname>Id</varname> property exposes the numeric transfer ID of the transfer object.</para>
<para>The <varname>Local</varname>, <varname>Remote</varname> and <varname>Type</varname> properties
expose the local container name of this transfer, the remote source (in case of download: the URL, in
case of import/export: a string describing the file descriptor passed in), and the type of operation
(see the Manager's <function>ListTransfer()</function> method above for an explanation of the possible
values).</para>
<para>The <varname>Verify</varname> property exposes the selected verification setting and is only
defined for download operations (see above).</para>
<para>The <varname>Progress</varname> property exposes the current progress of the transfer as a value
between 0.0 and 1.0. To show a progress bar on screen we recommend to query this value in regular
intervals, for example every 500 ms or so.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
</refentry>

View File

@ -1,149 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.locale1" conditional='ENABLE_LOCALED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.locale1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.locale1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.locale1</refname>
<refpurpose>The D-Bus interface of systemd-localed</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-localed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that can be used to control the system locale and keyboard mapping from user
programs. This page describes the D-Bus interface.</para>
</refsect1>
<refsect1>
<title>The D-Bus API</title>
<para>The service exposes the following interfaces on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.locale1 \
--object-path /org/freedesktop/locale1
node /org/freedesktop/locale1 {
interface org.freedesktop.locale1 {
methods:
SetLocale(in as locale,
in b interactive);
SetVConsoleKeyboard(in s keymap,
in s keymap_toggle,
in b convert,
in b interactive);
SetX11Keyboard(in s layout,
in s model,
in s variant,
in s options,
in b convert,
in b interactive);
properties:
readonly as Locale = ['...', ...];
readonly s X11Layout = '...';
readonly s X11Model = '...';
readonly s X11Variant = '...';
readonly s X11Options = '...';
readonly s VConsoleKeymap = '...';
readonly s VConsoleKeymapToggle = '...';
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para>If you set a new system locale all old system locale settings will be dropped and the new
settings will be saved to disk. The locale will also be passed to the system manager, and subsequently started
daemons will inherit the new system locale. Note that already running daemons will not learn about the
new value.</para>
<para>The <function>SetVConsoleKeyboard()</function> call may be used to set the key mapping for the
virtual console. Similarly, <function>SetX11Keyboard()</function> may be used to set the default key
mapping of any X11 servers.</para>
<para>Note that <function>SetVConsoleKeyboard()</function> instantly applies the new key mapping to the
console, while <function>SetX11Keyboard()</function> simply sets a default that may be used by later
sessions.</para>
<para>The boolean argument <varname>convert</varname> may be set to optionally convert the console
keyboard configuration to X11 keyboard mappings and vice versa. If true and
<function>SetVConsoleKeyboard()</function> is used, the nearest X11 keyboard setting for the chosen
console setting is set. If true and <function>SetX11Keyboard()</function> is used, the nearest console
keyboard setting for the chosen X11 setting is set. Hence, it is usually sufficient to call only one of the
two functions.</para>
<para>For graphical UIs that need to set the system keyboard mapping simply invoke
<function>SetX11Keyboard()</function>, set <varname>convert=true</varname> and ignore
<function>SetVConsoleKeyboard()</function>.</para>
<para>Use the empty string for the keymap parameters you wish not to set.</para>
<para>The <varname>interactive</varname> boolean parameters can be used to control whether PolicyKit
should interactively ask the user for authentication credentials if required.</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>Whenever the system locale or keymap is changed via the daemon,
<function>PropertyChanged</function> signals are sent out to which clients can subscribe.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para>The system locale is shown in the <varname>Locale</varname> property. It is an array containing
environment-variable-assignment-like strings. The following strings are known:
<varname>LANG=</varname>, <varname>LC_CTYPE=</varname>, <varname>LC_NUMERIC=</varname>,
<varname>LC_TIME=</varname>, <varname>LC_COLLATE=</varname>, <varname>LC_MONETARY=</varname>,
<varname>LC_MESSAGES=</varname>, <varname>LC_PAPER=</varname>, <varname>LC_NAME=</varname>,
<varname>LC_ADDRESS=</varname>, <varname>LC_TELEPHONE=</varname>, <varname>LC_MEASUREMENT=</varname>,
<varname>LC_IDENTIFICATION=</varname>.</para>
<para>The <varname>X11Layout</varname>, <varname>X11Model</varname>, <varname>X11Variant</varname>, and
<varname>X11Options</varname> properties show values configurable with
<function>SetX11Keyboard()</function> described above (or <function>SetVConsoleKeyboard()</function>
with <varname>convert=true</varname>). The <varname>VConsoleKeymap</varname> and
<varname>VConsoleKeymapToggle</varname> properties show values configurable with
<function>SetVConsoleKeyboard()</function> (or <function>SetX11Keyboard()</function> with
<varname>convert=true</varname>).</para>
</refsect2>
<refsect2>
<title>Security</title>
<para>Changing the system locale or keymap using this interface is authenticated via PolicyKit. The
PolicyKit action for <function>SetLocale()</function> is
<constant>org.freedesktop.locale1.set-locale</constant>. The PolicyKit action for
<function>SetX11Keyboard()</function> and <function>SetVConsoleKeyboard()</function> is
<constant>org.freedesktop.locale1.set-keyboard</constant>.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
</refentry>

View File

@ -1,982 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.login1" conditional='ENABLE_LOGIND'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.login1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.login1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.login1</refname>
<refpurpose>The D-Bus interface of systemd-logind</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para><citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that keeps track of user logins and seats.</para>
<para>The daemon provides both a C library interface as well as a D-Bus interface. The library interface
may be used to introspect and watch the state of user logins and seats. The bus interface provides the
same functionality but in addition may also be used to make changes to the system state. For more information please
consult <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1>
<title>The Manager Object</title>
<para>The service exposes the following interfaces on the Manager object on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1
node /org/freedesktop/login1 {
interface org.freedesktop.login1.Manager {
methods:
GetSession(in s session_id,
out o object_path);
GetSessionByPID(in u pid,
out o object_path);
GetUser(in u uid,
out o object_path);
GetUserByPID(in u pid,
out o object_path);
GetSeat(in s seat_id,
out o object_path);
ListSessions(out a(susso) sessions);
ListUsers(out a(uso) users);
ListSeats(out a(so) seats);
ListInhibitors(out a(ssssuu) inhibitors);
CreateSession(in u uid,
in u pid,
in s service,
in s type,
in s class,
in s desktop,
in s seat_id,
in u vtnr,
in s tty,
in s display,
in b remote,
in s remote_user,
in s remote_host,
in a(sv) properties,
out s session_id,
out o object_path,
out s runtime_path,
out h fifo_fd,
out u uid,
out s seat_id,
out u vtnr,
out b existing);
ReleaseSession(in s session_id);
ActivateSession(in s session_id);
ActivateSessionOnSeat(in s session_id,
in s seat_id);
LockSession(in s session_id);
UnlockSession(in s session_id);
LockSessions();
UnlockSessions();
KillSession(in s session_id,
in s who,
in i signal_number);
KillUser(in u uid,
in i signal_number);
TerminateSession(in s session_id);
TerminateUser(in u uid);
TerminateSeat(in s seat_id);
SetUserLinger(in u uid,
in b enable,
in b interactive);
AttachDevice(in s seat_id,
in s sysfs_path,
in b interactive);
FlushDevices(in b interactive);
PowerOff(in b interactive);
Reboot(in b interactive);
Halt(in b interactive);
Suspend(in b interactive);
Hibernate(in b interactive);
HybridSleep(in b interactive);
SuspendThenHibernate(in b interactive);
CanPowerOff(out s result);
CanReboot(out s result);
CanHalt(out s result);
CanSuspend(out s result);
CanHibernate(out s result);
CanHybridSleep(out s result);
CanSuspendThenHibernate(out s result);
ScheduleShutdown(in s type,
in t usec);
CancelScheduledShutdown(out b cancelled);
Inhibit(in s what,
in s who,
in s why,
in s mode,
out h pipe_fd);
CanRebootParameter(out s result);
SetRebootParameter(in s parameter);
CanRebootToFirmwareSetup(out s result);
SetRebootToFirmwareSetup(in b enable);
CanRebootToBootLoaderMenu(out s result);
SetRebootToBootLoaderMenu(in t timeout);
CanRebootToBootLoaderEntry(out s result);
SetRebootToBootLoaderEntry(in s boot_loader_entry);
SetWallMessage(in s wall_message,
in b enable);
signals:
SessionNew(s session_id,
o object_path);
SessionRemoved(s session_id,
o object_path);
UserNew(u uid,
o object_path);
UserRemoved(u uid,
o object_path);
SeatNew(s seat_id,
o object_path);
SeatRemoved(s seat_id,
o object_path);
PrepareForShutdown(b start);
PrepareForSleep(b start);
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
@org.freedesktop.systemd1.Privileged("true")
readwrite b EnableWallMessages = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
@org.freedesktop.systemd1.Privileged("true")
readwrite s WallMessage = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u NAutoVTs = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as KillOnlyUsers = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as KillExcludeUsers = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b KillUserProcesses = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s RebootParameter = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b RebootToFirmwareSetup = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t RebootToBootLoaderMenu = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s RebootToBootLoaderEntry = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly as BootLoaderEntries = ['...', ...];
readonly b IdleHint = ...;
readonly t IdleSinceHint = ...;
readonly t IdleSinceHintMonotonic = ...;
readonly s BlockInhibited = '...';
readonly s DelayInhibited = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t InhibitDelayMaxUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t UserStopDelayUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandlePowerKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleSuspendKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleHibernateKey = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleLidSwitch = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleLidSwitchExternalPower = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s HandleLidSwitchDocked = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t HoldoffTimeoutUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s IdleAction = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t IdleActionUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b PreparingForShutdown = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b PreparingForSleep = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly (st) ScheduledShutdown = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b Docked = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b LidClosed = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b OnExternalPower = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b RemoveIPC = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t RuntimeDirectorySize = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t InhibitorsMax = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t NCurrentInhibitors = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t SessionsMax = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t NCurrentSessions = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>GetSession()</function> may be used to get the session object path for the session with
the specified ID. Similarly, <function>GetUser()</function> and <function>GetSeat()</function> get the
user and seat objects, respectively. <function>GetSessionByPID()</function> and
<function>GetUserByPID()</function> get the session/user object the specified PID belongs to if there
is any.</para>
<para><function>ListSessions()</function> returns an array of all current sessions. The structures in
the array consist of the following fields: session id, user id, user name, seat id, session object
path. If a session does not have a seat attached, the seat id field will be an empty string.</para>
<para><function>ListUsers()</function> returns an array of all currently logged in users. The
structures in the array consist of the following fields: user id, user name, user object path.</para>
<para><function>ListSeats()</function> returns an array of all currently available seats. The
structure in the array consists of the following fields: seat id, seat object path.</para>
<para><function>ListInhibitors()</function> lists all currently active inhibitors. It returns an array of
structures consisting of <varname>what</varname>, <varname>who</varname>, <varname>why</varname>,
<varname>mode</varname>, <varname>uid</varname> (user ID), and <varname>pid</varname> (process ID).</para>
<para><function>CreateSession()</function> and <function>ReleaseSession()</function> may be used to
open or close login sessions. These calls should <emphasis>never</emphasis> be invoked directly by
clients. Creating/closing sessions is exclusively the job of PAM and its
<citerefentry><refentrytitle>pam_systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
module.</para>
<para><function>ActivateSession()</function> brings the session with the specified ID into the
foreground. <function>ActivateSessionOnSeat()</function> does the same, but only if the seat id
matches.</para>
<para><function>LockSession()</function> asks the session with the specified ID to activate the screen
lock. <function>UnlockSession()</function> asks the session with the specified ID to remove an active
screen lock, if there is any. This is implemented by sending out the Lock() and Unlock() signals from
the respective session object which session managers are supposed to listen on.</para>
<para><function>LockSessions()</function> asks all sessions to activate their screen locks. This may be
used to lock access to the entire machine in one action. Similarly, <function>UnlockSessions()</function>
asks all sessions to deactivate their screen locks.</para>
<para><function>KillSession()</function> may be used to send a Unix signal to one or all processes of a
session. As arguments it takes the session id, either the string <literal>leader</literal> or
<literal>all</literal> and a signal number. If <literal>leader</literal> is passed only the session
<literal>leader</literal> is killed. If <literal>all</literal> is passed all processes of the session
are killed.</para>
<para><function>KillUser()</function> may be used to send a Unix signal to all processes of a user. As
arguments it takes the user id and a signal number.</para>
<para><function>TerminateSession()</function>, <function>TerminateUser()</function>,
<function>TerminateSeat()</function> may be used to forcibly terminate one specific session, all
processes of a user, and all sessions attached to a specific seat, respectively. The session, user,
and seat are identified by their respective IDs.</para>
<para><function>SetUserLinger()</function> enables or disables user lingering. If enabled, the runtime
directory of a user is kept around and he may continue to run processes while he is logged out. If
disabled, the runtime directory goes away as soon as they log out. <function>SetUserLinger()</function>
expects three arguments: the UID, a boolean whether to enable/disable and a boolean controlling the
PolicyKit authorization interactivity (see below). Note that the user linger state is persistently
stored on disk.</para>
<para><function>AttachDevice()</function> may be used to assign a specific device to a specific
seat. The device is identified by its /sys path and must be eligible for seat assignments. <function>AttachDevice()</function> takes three
arguments: the seat id, the sysfs path, and a boolean for controlling PolicyKit interactivity (see
below). Device assignments are persistently stored on disk. To create a new seat, simply specify a
previously unused seat id. For more information about the seat assignment logic see
<ulink url="https://www.freedesktop.org/wiki/Software/systemd/multiseat">Multi-Seat for Linux</ulink>.
</para>
<para><function>FlushDevices()</function> removes all explicit seat assignments for devices, resetting
all assignments to the automatic defaults. The only argument it takes is the PolicyKit interactivity
boolean (see below).</para>
<para><function>PowerOff()</function>, <function>Reboot()</function>, <function>Halt()</function>,
<function>Suspend()</function>, and <function>Hibernate()</function> result in the system being powered
off, rebooted, halted (shut down without turning off power), suspended (the system state is
saved to RAM and the CPU is turned off), or hibernated (the system state is saved to disk and
the machine is powered down). <function>HybridSleep()</function> results in the system entering a
hybrid-sleep mode, i.e. the system is both hibernated and suspended.
<function>SuspendThenHibernate()</function> results in the system being suspended, then later woken
using an RTC timer and hibernated. The only argument is the PolicyKit interactivity boolean
<varname>interactive</varname> (see below). The main purpose of these calls is that they enforce
PolicyKit policy and hence allow powering off/rebooting/suspending/hibernating even by unprivileged
users. They also enforce inhibition locks. UIs should expose these calls as the primary mechanism to
poweroff/reboot/suspend/hibernate the machine.</para>
<para><function>SetRebootParameter()</function> sets a parameter for a subsequent reboot operation.
See the description of <command>reboot</command> in
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
<citerefentry project="man-pages"><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for more information.</para>
<para><function>SetRebootToFirmwareSetup()</function>,
<function>SetRebootToBootLoaderMenu()</function>, and <function>SetRebootToBootLoaderEntry()</function>
configure the action to be taken from the boot loader after a reboot: respectively entering firmware
setup mode, the boot loader menu, or a specific boot loader entry. See
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for the
corresponding command line interface.</para>
<para><function>CanPowerOff()</function>, <function>CanReboot()</function>,
<function>CanHalt()</function>, <function>CanSuspend()</function>, <function>CanHibernate()</function>,
<function>CanHybridSleep()</function>, <function>CanSuspendThenHibernate()</function>,
<function>CanRebootParameter()</function>, <function>CanRebootToFirmwareSetup()</function>,
<function>CanRebootToBootLoaderMenu()</function>, and
<function>CanRebootToBootLoaderEntry()</function> test whether the system supports the respective
operation and whether the calling user is allowed to execute it. Returns one of <literal>na</literal>,
<literal>yes</literal>, <literal>no</literal>, and <literal>challenge</literal>. If
<literal>na</literal> is returned, the operation is not available because hardware, kernel, or drivers
do not support it. If <literal>yes</literal> is returned, the operation is supported and the user may
execute the operation without further authentication. If <literal>no</literal> is returned, the
operation is available but the user is not allowed to execute the operation. If
<literal>challenge</literal> is returned, the operation is available but only after
authorization.</para>
<para><function>ScheduleShutdown()</function> schedules a shutdown operation <varname>type</varname> at
time <varname>usec</varname> in microseconds since the UNIX epoch. <varname>type</varname> can be one
of <literal>poweroff</literal>, <literal>dry-poweroff</literal>, <literal>reboot</literal>,
<literal>dry-reboot</literal>, <literal>halt</literal>, and <literal>dry-halt</literal>. (The
<literal>dry-</literal> variants do not actually execute the shutdown action.)
<function>CancelScheduledShutdown()</function> cancels a scheduled shutdown. The output parameter
<varname>cancelled</varname> is true if a shutdown operation was scheduled.</para>
<para><function>SetWallMessage()</function> sets the wall message (the message that will be sent out to
all terminals and stored in a
<citerefentry><refentrytitle>utmp</refentrytitle><manvolnum>5</manvolnum></citerefentry> record) for a
subsequent scheduled shutdown operation. The parameter <varname>wall_message</varname> specifies the
shutdown reason (and may be empty) which will be included in the shutdown message. The parameter
<varname>enable</varname> specifies whether to print a wall message on shutdown.</para>
<para><function>Inhibit()</function> creates an inhibition lock. It takes four parameters:
<varname>what</varname>, <varname>who</varname>, <varname>why</varname>, and
<varname>mode</varname>. <varname>what</varname> is one or more of <literal>shutdown</literal>,
<literal>sleep</literal>, <literal>idle</literal>, <literal>handle-power-key</literal>,
<literal>handle-suspend-key</literal>, <literal>handle-hibernate-key</literal>,
<literal>handle-lid-switch</literal>, separated by colons, for inhibiting poweroff/reboot,
suspend/hibernate, the automatic idle logic, or hardware key handling. <varname>who</varname> should be
a short human readable string identifying the application taking the lock. <varname>why</varname>
should be a short human readable string identifying the reason why the lock is taken. Finally,
<varname>mode</varname> is either <literal>block</literal> or <literal>delay</literal> which encodes
whether the inhibit shall be consider mandatory or whether it should just delay the operation to a
certain maximum time. The call returns a file descriptor. The lock is released the moment this file
descriptor and all its duplicates are closed. For more information on the inhibition logic see
<ulink url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>.
</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>Whenever the inhibition state or idle hint changes, <function>PropertyChanged</function>
signals are sent out to which clients can subscribe.</para>
<para>The <function>SessionNew</function>, <function>SessionRemoved</function>,
<function>UserNew</function>, <function>UserRemoved</function>, <function>SeatNew</function>, and
<function>SeatRemoved</function> signals are sent each time a session is created or removed, a user
logs in or out, or a seat is added or removed. They each contain the ID of the object plus the object
path.</para>
<para>The <function>PrepareForShutdown()</function> and <function>PrepareForSleep()</function> signals
are sent right before (with the argument <literal>true</literal>) or after (with the argument
<literal>false</literal>) the system goes down for reboot/poweroff and suspend/hibernate,
respectively. This may be used by applications to save data on disk, release memory, or do other jobs
that should be done shortly before shutdown/sleep, in conjunction with delay inhibitor locks. After
completion of this work they should release their inhibition locks in order to not delay the operation
any further. For more information see
<ulink url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor Locks</ulink>.
</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para>Most properties simply reflect the configuration, see
<citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
includes: <varname>NAutoVTs</varname>, <varname>KillOnlyUsers</varname>,
<varname>KillExcludeUsers</varname>, <varname>KillUserProcesses</varname>, <varname>IdleAction</varname>,
<varname>InhibitDelayMaxUSec</varname>,
<varname>InhibitorsMax</varname>,
<varname>UserStopDelayUSec</varname>,
<varname>HandlePowerKey</varname>, <varname>HandleSuspendKey</varname>,
<varname>HandleHibernateKey</varname>, <varname>HandleLidSwitch</varname>,
<varname>HandleLidSwitchExternalPower</varname>, <varname>HandleLidSwitchDocked</varname>,
<varname>IdleActionUSec</varname>, <varname>HoldoffTimeoutUSec</varname>,
<varname>RemoveIPC</varname>, <varname>RuntimeDirectorySize</varname>,
<varname>InhibitorsMax</varname>, and <varname>SessionsMax</varname>.
</para>
<para>The <varname>IdleHint</varname> property reflects the idle hint state of the system. If the
system is idle it might get into automatic suspend or shutdown depending on the configuration.</para>
<para><varname>IdleSinceHint</varname> and <varname>IdleSinceHintMonotonic</varname> encode the
timestamps of the last change of the idle hint boolean, in <constant>CLOCK_REALTIME</constant> and
<constant>CLOCK_MONOTONIC</constant> timestamps, respectively, in microseconds since the epoch.</para>
<para>The <varname>BlockInhibited</varname> and <varname>DelayInhibited</varname> properties encode
the currently active locks of the respective modes. They are colon separated lists of
<literal>shutdown</literal>, <literal>sleep</literal>, and <literal>idle</literal> (see above).</para>
<para><varname>NCurrentSessions</varname> and <varname>NCurrentInhibitors</varname> contain the number
of currently registered sessions and inhibitors.</para>
<para>The <varname>BootLoaderEntries</varname> property contains a list of boot loader entries.
This includes boot loader entries defined in configuration and any additional loader entries
reported by the boot loader. See
<citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for more information.</para>
<para>The <varname>PreparingForShutdown</varname> and <varname>PreparingForSleep</varname> boolean
properties are true during the interval between the two <function>PrepareForShutdown</function> and
<function>PrepareForSleep</function> signals respectively. Note that these properties do not
send out <function>PropertyChanged</function> signals.</para>
<para>The <varname>RebootParameter</varname> property shows the value set with the
<function>SetRebootParameter()</function> method described above.</para>
<para><varname>ScheduledShutdown</varname> shows the value pair set with the
<function>ScheduleShutdown()</function> method described above.</para>
<para><varname>RebootToFirmwareSetup</varname>, <varname>RebootToBootLoaderMenu</varname>, and
<varname>RebootToBootLoaderEntry</varname> are true when the resprective post-reboot operation was
selected with <function>SetRebootToFirmwareSetup</function>,
<function>SetRebootToBootLoaderMenu</function>, or
<function>SetRebootToBootLoaderEntry</function>.</para>
<para>The <varname>WallMessage</varname> and <varname>EnableWallMessages</varname> properties reflect the
shutdown reason and wall message enablement switch which can be set with the
<function>SetWallMessage()</function> method described above.</para>
<para><varname>Docked</varname> is true if the machine is connected to a dock.
<varname>LidClosed</varname> is true when the lid (of a laptop) is closed.
<varname>OnExternalPower</varname> is true when the machine is connected to an external power supply.
</para>
</refsect2>
<refsect2>
<title>Security</title>
<para>A number of operations are protected via the PolicyKit privilege
system. <function>SetUserLinger()</function> requires the
<interfacename>org.freedesktop.login1.set-user-linger</interfacename>
privilege. <function>AttachDevice()</function> requires
<interfacename>org.freedesktop.login1.attach-device</interfacename> and
<function>FlushDevices()</function> requires
<interfacename>org.freedesktop.login1.flush-devices</interfacename>. <function>PowerOff()</function>,
<function>Reboot()</function>, <function>Halt()</function>, <function>Suspend()</function>,
<function>Hibernate()</function> require
<interfacename>org.freedesktop.login1.power-off</interfacename>,
<interfacename>org.freedesktop.login1.power-off-multiple-sessions</interfacename>,
<interfacename>org.freedesktop.login1.power-off-ignore-inhibit</interfacename>,
<interfacename>org.freedesktop.login1.reboot</interfacename>,
<interfacename>org.freedesktop.login1.reboot-multiple-sessions</interfacename>,
<interfacename>org.freedesktop.login1.reboot-ignore-inhibit</interfacename>,
<interfacename>org.freedesktop.login1.halt</interfacename>,
<interfacename>org.freedesktop.login1.halt-multiple-sessions</interfacename>,
<interfacename>org.freedesktop.login1.halt-ignore-inhibit</interfacename>,
<interfacename>org.freedesktop.login1.suspend</interfacename>,
<interfacename>org.freedesktop.login1.suspend-multiple-sessions</interfacename>,
<interfacename>org.freedesktop.login1.suspend-ignore-inhibit</interfacename>,
<interfacename>org.freedesktop.login1.hibernate</interfacename>,
<interfacename>org.freedesktop.login1.hibernate-multiple-sessions</interfacename>,
<interfacename>org.freedesktop.login1.hibernate-ignore-inhibit</interfacename>,
respectively depending on whether there are other sessions around or active inhibits are present.
<function>HybridSleep()</function> and <function>SuspendThenHibernate()</function>
use the same privileges as <function>Hibernate()</function>.
<function>SetRebootParameter()</function> requires
<interfacename>org.freedesktop.login1.set-reboot-parameter</interfacename>.</para>
<para><function>SetRebootToFirmwareSetup</function> requires
<interfacename>org.freedesktop.login1.set-reboot-to-firmware-setup</interfacename>.
<function>SetRebootToBootLoaderMenu</function> requires
<interfacename>org.freedesktop.login1.set-reboot-to-boot-loader-menu</interfacename>.
<function>SetRebootToBootLoaderEntry</function> requires
<interfacename>org.freedesktop.login1.set-reboot-to-boot-loader-entry</interfacename>.
</para>
<para><function>ScheduleShutdown</function> and <function>CancelScheduledShutdown</function> require
the same privileges (listed above) as the immediate poweroff/reboot/halt operations.</para>
<para><function>Inhibit()</function> is protected via one of
<interfacename>org.freedesktop.login1.inhibit-block-shutdown</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-delay-shutdown</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-block-sleep</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-delay-sleep</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-block-idle</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-handle-power-key</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-handle-suspend-key</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-handle-hibernate-key</interfacename>,
<interfacename>org.freedesktop.login1.inhibit-handle-lid-switch</interfacename> depending on the lock
type and mode taken.</para>
<para>The <varname>interactive</varname> boolean parameters can be used to control whether PolicyKit
should interactively ask the user for authentication credentials if required.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Seat Objects</title>
<programlisting>
$ gdbus introspect --system --dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1/seat/seat0
node /org/freedesktop/login1/seat/seat0 {
interface org.freedesktop.login1.Seat {
methods:
Terminate();
ActivateSession(in s session_id);
SwitchTo(in u vtnr);
SwitchToNext();
SwitchToPrevious();
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Id = '...';
readonly (so) ActiveSession = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanMultiSession = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b CanTTY = ...;
readonly b CanGraphical = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(so) Sessions = [...];
readonly b IdleHint = ...;
readonly t IdleSinceHint = ...;
readonly t IdleSinceHintMonotonic = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>Terminate()</function> and <function>ActivateSession()</function> work similar to
TerminateSeat(), ActivationSessionOnSeat() on the Manager object.</para>
<para><function>SwitchTo()</function> switches to the session on the virtual terminal
<varname>vtnr</varname>. <function>SwitchToNext()</function> and
<function>SwitchToPrevious()</function> switch to, respectively, the next and previous sessions on the
seat in the order of virtual terminals. If there is no active session, they switch to, respectively,
the first and last session on the seat.</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>Whenever <function>ActiveSession</function>, <function>Sessions</function>,
<function>CanGraphical</function>, <function>CanMultiSession</function> and <function>CanTTY</function>
or the idle state changes, <function>PropertyChanged</function> signals are sent out to which clients
can subscribe.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para>The <varname>Id</varname> property encodes the ID of the seat.</para>
<para><varname>ActiveSession</varname> encodes the currently active session if there is one. It is a
structure consisting of the session id and the object path.</para>
<para><varname>CanMultiSession</varname> encodes whether the session is multi-session capable,
<varname>CanTTY</varname> whether it is suitable for text logins, <varname>CanGraphical</varname>
whether it is suitable for graphical sessions.</para>
<para>The <varname>Sessions</varname> property is an array of all current sessions of this seat, each
encoded in a structure consisting of the ID and the object path.</para>
<para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
<varname>IdleSinceHint</varname> properties encode the idle state, similar to the one exposed on the
Manager object, but specific for this seat.</para>
</refsect2>
</refsect1>
<refsect1>
<title>User Objects</title>
<programlisting>
$ gdbus introspect --system --dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1/user/_1000
node /org/freedesktop/login1/user/_1000 {
interface org.freedesktop.login1.User {
methods:
Terminate();
Kill(in i signal_number);
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u UID = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u GID = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Name = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t Timestamp = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t TimestampMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s RuntimePath = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Service = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Slice = '...';
readonly (so) Display = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s State = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(so) Sessions = [...];
readonly b IdleHint = ...;
readonly t IdleSinceHint = ...;
readonly t IdleSinceHintMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b Linger = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>Terminate()</function> and <function>Kill()</function> work similar to the
<function>TerminateUser()</function> and <function>KillUser()</function> methods on the manager
object.</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>Whenever <varname>Sessions</varname> or the idle state changes,
<function>PropertyChanged</function> signals are sent out to which clients can subscribe.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para>The <varname>UID</varname> and <varname>GID</varname> properties encode the Unix UID and primary
GID of the user.</para>
<para>The <varname>Name</varname> property encodes the user name.</para>
<para><varname>Timestamp</varname> and <varname>TimestampMonotonic</varname> encode the login time of
the user in microseconds since the epoch, in the <constant>CLOCK_REALTIME</constant> and
<constant>CLOCK_MONOTONIC</constant> clocks, respectively.</para>
<para><varname>RuntimePath</varname> encodes the runtime path of the user,
i.e. <varname>$XDG_RUNTIME_DIR</varname>. For details see the
<ulink url="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">
XDG Basedir Specification
</ulink>.</para>
<para><varname>Service</varname> contains the unit name of the user systemd service of this
user. Each logged in user is assigned a user service that runs a user systemd instance. This is
usually an instance of <filename>user@.service</filename>.</para>
<para><varname>Slice</varname> contains the unit name of the user systemd slice of this user. Each
logged in user gets a private slice.</para>
<para><varname>Display</varname> encodes which graphical session should be used as the primary UI display
for the user. It is a structure encoding the session ID and the object path of the session to use.</para>
<para><varname>State</varname> encodes the user state and is one of <literal>offline</literal>,
<literal>lingering</literal>, <literal>online</literal>, <literal>active</literal>, or
<literal>closing</literal>. See
<citerefentry><refentrytitle>sd_uid_get_state</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the states.</para>
<para><varname>Sessions</varname> is an array of structures encoding all current sessions of the
user. Each structure consists of the ID and object path.</para>
<para>The <varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
<varname>IdleSinceHintMonotonic</varname> properties encode the idle hint state of the user, similar to
the <interfacename>Manager</interfacename>'s properties, but specific for this user.</para>
<para>The <varname>Linger</varname> property shows whether lingering is enabled for this user.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Session Objects</title>
<programlisting>
$ gdbus introspect --system --dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1/session/45
node /org/freedesktop/login1/session/45 {
interface org.freedesktop.login1.Session {
methods:
Terminate();
Activate();
Lock();
Unlock();
SetIdleHint(in b idle);
SetLockedHint(in b locked);
Kill(in s who,
in i signal_number);
TakeControl(in b force);
ReleaseControl();
TakeDevice(in u major,
in u minor,
out h fd,
out b inactive);
ReleaseDevice(in u major,
in u minor);
PauseDeviceComplete(in u major,
in u minor);
SetBrightness(in s subsystem,
in s name,
in u brightness);
signals:
PauseDevice(u major,
u minor,
s type);
ResumeDevice(u major,
u minor,
h fd);
Lock();
Unlock();
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Id = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly (uo) User = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Name = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t Timestamp = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t TimestampMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u VTNr = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly (so) Seat = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s TTY = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Display = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly b Remote = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s RemoteHost = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s RemoteUser = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Service = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Desktop = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Scope = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u Leader = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u Audit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Type = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Class = '...';
readonly b Active = ...;
readonly s State = '...';
readonly b IdleHint = ...;
readonly t IdleSinceHint = ...;
readonly t IdleSinceHintMonotonic = ...;
readonly b LockedHint = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>Terminate()</function>, <function>Activate()</function>, <function>Lock()</function>,
<function>Unlock()</function>, and <function>Kill()</function> work similarly to the respective calls on
the <interfacename>Manager</interfacename> object.</para>
<para><function>SetIdleHint()</function> is called by the session object to update the idle state
of the session whenever it changes.</para>
<para><function>TakeControl()</function> allows a process to take exclusive managed device
access-control for that session. Only one D-Bus connection can be a controller for a given session at any
time. If the <varname>force</varname> argument is set (root only), an existing controller is kicked
out and replaced. Otherwise, this call fails if there is already a controller. Note that this call is
limited to D-Bus users with the effective UID set to the user of the session or root.</para>
<para><function>ReleaseControl()</function> drops control of a given session. Closing the
D-Bus connection implicitly releases control as well. See <function>TakeControl()</function> for more information. This
method also releases all devices for which the controller requested ownership via <function>TakeDevice()</function>.
</para>
<para><function>TakeDevice()</function> allows a session controller to get a file descriptor for a
specific device. Pass in the major and minor numbers of the character device and
<filename>systemd-logind</filename> will return a file descriptor for the device. Only a limited set of
device-types is currently supported (but may be extended). <filename>systemd-logind</filename>
automatically mutes the file descriptor if the session is inactive and resumes it once the session is
activated again. This guarantees that a session can only access session devices if the session is
active. Note that this revoke/resume mechanism is asynchronous and may happen at any given time. This
only works on devices that are attached to the seat of the given session. A process is not required to
have direct access to the device node. <filename>systemd-logind</filename> only requires you to be the
active session controller (see <function>TakeControl()</function>). Also note that any device can only
be requested once. As long as you don't release it, further <function>TakeDevice()</function> calls
will fail.</para>
<para><function>ReleaseDevice()</function> releases a device again (see
<function>TakeDevice()</function>). This is also implicitly done by
<function>ReleaseControl()</function> or when closing the D-Bus connection.</para>
<para><function>PauseDeviceComplete()</function> allows a session controller to synchronously pause a
device after receiving a <function>PauseDevice(<literal>pause</literal>)</function> signal. Forced
signals (or after an internal timeout) are automatically completed by
<filename>systemd-logind</filename> asynchronously.</para>
<para><function>SetLockedHint()</function> may be used to set the "idle hint" to
<varname>locked</varname>, i.e. information whether the session is locked. This is intended to be used
by the desktop environment to tell <command>systemd-logind</command> when the session is locked and
unlocked.</para>
<para><function>SetBrightness()</function> may be used to set the display brightness. This is intended
to be used by the desktop environment and allows unprivileged programs to access hardware settings in
a controlled way. The <varname>subsystem</varname> parameter specifies a kernel subsystem, either
<literal>backlight</literal> or <literal>leds</literal>. The <varname>name</varname> parameter
specifies a device name under the specified subsystem. The <varname>brightness</varname> parameter
specifies the brightness. The range is defined by individual drivers, see
<filename>/sys/class/<varname>subsystem</varname>/<varname>name</varname>/max_brightness</filename>.
</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para>The active session controller exclusively gets <function>PauseDevice</function> and
<function>ResumeDevice</function> events for any device it requested via
<function>TakeDevice()</function>. They notify the controller whenever a device is paused or resumed. A
device is never resumed if its session is inactive. Also note that <function>PauseDevice</function>
signals are sent before the <function>PropertyChanged</function> signal for the
<function>Active</function> state. The inverse is true for <function>ResumeDevice</function>. A device
may remain paused for unknown reasons even though the <interfacename>Session</interfacename> is active.
</para>
<para>A <function>PauseDevice</function> signal carries the major and minor numbers and a string describing the
type as arguments. <function>force</function> means the device was already paused by
<filename>systemd-logind</filename> and the signal is only an asynchronous
notification. <function>pause</function> means <filename>systemd-logind</filename> grants you a limited amount of time to pause the device. You must respond to this via
<function>PauseDeviceComplete()</function>. This synchronous pausing mechanism is used for
backwards-compatibility to VTs and <filename>systemd-logind</filename> is free to not make use of
it. It is also free to send a forced <function>PauseDevice</function> if you don't respond in a timely
manner (or for any other reason). <function>gone</function> means the device was unplugged from the
system and you will no longer get any notifications about it. There is no need to call
<function>ReleaseDevice()</function>. You may call <function>TakeDevice()</function> again if a new
device is assigned the major+minor combination.</para>
<para><function>ResumeDevice</function> is sent whenever a session is active and a device is
resumed. It carries the major/minor numbers as arguments and provides a new open file descriptor. You should
switch to the new descriptor and close the old one. They are not guaranteed to have the same underlying
open file descriptor in the kernel (except for a limited set of device types).</para>
<para>Whenever <function>Active</function> or the idle state changes,
<function>PropertyChanged</function> signals are sent out to which clients can subscribe.</para>
<para><function>Lock</function>/<function>Unlock</function> is sent when the session is asked to be
screen-locked/unlocked. A session manager of the session should listen to this signal and act
accordingly. This signal is sent out as a result of the <function>Lock()</function> and
<function>Unlock()</function> methods, respectively.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para><varname>Id</varname> encodes the session ID.</para>
<para><varname>User</varname> encodes the user ID of the user this session belongs to. This is a
structure consisting of the Unix UID and the object path.</para>
<para><varname>Name</varname> encodes the user name.</para>
<para><varname>Timestamp</varname> and <varname>TimestampMonotonic</varname> encode the microseconds
since the epoch when the session was created, in <constant>CLOCK_REALTIME</constant> or
<constant>CLOCK_MONOTONIC</constant>, respectively.</para>
<para><varname>VTNr</varname> encodes the virtual terminal number of the session if there is any, 0
otherwise.</para>
<para><varname>Seat</varname> encodes the seat this session belongs to if there is any. This is a
structure consisting of the ID and the seat object path.</para>
<para><varname>TTY</varname> encodes the kernel TTY path of the session if this is a text login. If not
this is an empty string.</para>
<para><varname>Display</varname> encodes the X11 display name if this is a graphical login. If not,
this is an empty string.</para>
<para><varname>Remote</varname> encodes whether the session is local or remote.</para>
<para><varname>RemoteHost</varname> and <varname>RemoteUser</varname> encode the remote host and user
if this is a remote session, or an empty string otherwise.</para>
<para><varname>Service</varname> encodes the PAM service name that registered the session.</para>
<para><varname>Desktop</varname> describes the desktop environment running in the session (if
known).</para>
<para><varname>Scope</varname> contains the systemd scope unit name of this session.</para>
<para><varname>Leader</varname> encodes the PID of the process that registered the session.</para>
<para><varname>Audit</varname> encodes the Kernel Audit session ID of the session if auditing is
available.</para>
<para><varname>Type</varname> encodes the session type. It's one of <literal>unspecified</literal> (for
cron PAM sessions and suchlike), <literal>tty</literal> (for text logins) or
<literal>x11</literal>/<literal>mir</literal>/<literal>wayland</literal> (for graphical logins).</para>
<para><varname>Class</varname> encodes the session class. It's one of <literal>user</literal> (for
normal user sessions), <literal>greeter</literal> (for display manager pseudo-sessions), or
<literal>lock-screen</literal> (for display lock screens).</para>
<para><varname>Active</varname> is a boolean that is true if the session is active, i.e. currently in the
foreground. This field is semi-redundant due to <varname>State</varname>.</para>
<para><varname>State</varname> encodes the session state and one of <literal>online</literal>,
<literal>active</literal>, or <literal>closing</literal>. See
<citerefentry><refentrytitle>sd_session_get_state</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the states.</para>
<para><varname>IdleHint</varname>, <varname>IdleSinceHint</varname>, and
<varname>IdleSinceHintMonotonic</varname> encapsulate the idle hint state of this session, similarly to
how the respective properties on the manager object do it for the whole system.</para>
<para><varname>LockedHint</varname> shows the locked hint state of this session, as set by the
<function>SetLockedHint()</function> method described above.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
</refentry>

View File

@ -1,448 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.machine1" conditional='ENABLE_MACHINED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.machine1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.machine1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.machine1</refname>
<refpurpose>The D-Bus interface of systemd-machined</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that keeps track of locally running virtual machines and containers.
This page describes the D-Bus interface.</para>
</refsect1>
<refsect1>
<title>The Manager Object</title>
<para>The service exposes the following interfaces on the Manager object on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.machine1 \
--object-path /org/freedesktop/machine1
node /org/freedesktop/machine1 {
interface org.freedesktop.machine1.Manager {
methods:
GetMachine(in s name,
out o machine);
GetImage(in s name,
out o image);
GetMachineByPID(in u pid,
out o machine);
ListMachines(out a(ssso) machines);
ListImages(out a(ssbttto) images);
CreateMachine(in s name,
in ay id,
in s service,
in s class,
in u leader,
in s root_directory,
in a(sv) scope_properties,
out o path);
CreateMachineWithNetwork(in s name,
in ay id,
in s service,
in s class,
in u leader,
in s root_directory,
in ai ifindices,
in a(sv) scope_properties,
out o path);
RegisterMachine(in s name,
in ay id,
in s service,
in s class,
in u leader,
in s root_directory,
out o path);
RegisterMachineWithNetwork(in s name,
in ay id,
in s service,
in s class,
in u leader,
in s root_directory,
in ai ifindices,
out o path);
UnregisterMachine(in s name);
TerminateMachine(in s id);
KillMachine(in s name,
in s who,
in i signal);
GetMachineAddresses(in s name,
out a(iay) addresses);
GetMachineOSRelease(in s name,
out a{ss} fields);
OpenMachinePTY(in s name,
out h pty,
out s pty_path);
OpenMachineLogin(in s name,
out h pty,
out s pty_path);
OpenMachineShell(in s name,
in s user,
in s path,
in as args,
in as environment,
out h pty,
out s pty_path);
BindMountMachine(in s name,
in s source,
in s destination,
in b read_only,
in b mkdir);
CopyFromMachine(in s name,
in s source,
in s destination);
CopyToMachine(in s name,
in s source,
in s destination);
OpenMachineRootDirectory(in s name,
out h fd);
GetMachineUIDShift(in s name,
out u shift);
RemoveImage(in s name);
RenameImage(in s name,
in s new_name);
CloneImage(in s name,
in s new_name,
in b read_only);
MarkImageReadOnly(in s name,
in b read_only);
GetImageHostname(in s name,
out s hostname);
GetImageMachineID(in s name,
out ay id);
GetImageMachineInfo(in s name,
out a{ss} machine_info);
GetImageOSRelease(in s name,
out a{ss} os_release);
SetPoolLimit(in t size);
SetImageLimit(in s name,
in t size);
CleanPool(in s mode,
out a(st) images);
MapFromMachineUser(in s name,
in u uid_inner,
out u uid_outer);
MapToMachineUser(in u uid_outer,
out s machine_name,
out o machine_path,
out u uid_inner);
MapFromMachineGroup(in s name,
in u gid_inner,
out u gid_outer);
MapToMachineGroup(in u gid_outer,
out s machine_name,
out o machine_path,
out u gid_inner);
signals:
MachineNew(s machine,
o path);
MachineRemoved(s machine,
o path);
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s PoolPath = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t PoolUsage = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t PoolLimit = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>GetMachine()</function> may be used to get the machine object path for the machine with
the specified name. Similarly, <function>GetMachineByPID()</function> gets the machine object the
specified PID belongs to if there is any.</para>
<para><function>GetImage()</function> may be used to get the image object path of the image with the
specified name.</para>
<para><function>ListMachines()</function> returns an array of all currently registered machines. The
structures in the array consist of the following fields: machine name, machine class, an identifier for
the service that registered the machine and the machine object path.</para>
<para><function>ListImages()</function> returns an array of all currently known images. The
structures in the array consist of the following fields: image name, type, read-only flag, creation
time, modification time, current disk space, and image object path.</para>
<para><function>CreateMachine()</function> may be used to register a new virtual machine or container
with <command>systemd-machined</command>, creating a scope unit for it. It accepts the following arguments: a
machine name chosen by the registrar, an optional UUID as a 32 byte array, a string that identifies the
service that registers the machine, a class string, the PID of the leader process of the machine, an
optional root directory of the container, and an array of additional properties to use for the scope
registration. The virtual machine name must be suitable as a hostname, and hence should follow the usual
DNS hostname rules, as well as the Linux hostname restrictions. Specifically, only 7 bit ASCII is
permitted, a maximum length of 64 characters is enforced, only characters from the set
<literal>a-zA-Z0-9-_.</literal> are allowed, the name may not begin with a dot, and it may not contain
two dots immediately following each other. Container and VM managers should ideally use the hostname
used internally in the machine for this parameter. This recommendation is made in order to make the
machine name naturally resolvable using
<citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>. If
a container manager needs to embed characters outside of the indicated range, escaping is required,
possibly using <literal>_</literal> as the escape character. Another (somewhat natural) option would be
to utilize Internet IDNA encoding. The UUID is passed as a 32 byte array or, if no suitable UUID is
available, an empty array (zero length) or zeroed out array shall be passed. The UUID should identify
the virtual machine/container uniquely and should ideally be the same UUID that
<filename>/etc/machine-id</filename> in the VM/container is initialized from. The service string can be
free-form, but it is recommended to pass a short lowercase identifier like
<literal>systemd-nspawn</literal>, <literal>libvirt-lxc</literal> or similar. The class string should
be either <literal>container</literal> or <literal>vm</literal> indicating whether the machine to
register is of the respective class. The leader PID should be the host PID of the init process of the
container or the encapsulating process of the VM. If the root directory of the container is known and
available in the host's hierarchy, it should be passed. Otherwise, pass the empty string instead. Finally, the
scope properties are passed as array in the same way as to PID1's
<function>StartTransientUnit()</function> method. Calling this method will internally register a transient scope
unit for the calling client (utilizing the passed scope_properties) and move the leader PID into
it. The call returns an object path for the registered machine object that implements the
<interfacename>org.freedesktop.machine1.Machine</interfacename> interface (see below). Also see the
<ulink url="https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New Control Group
Interfaces</ulink> for details about scope units and how to alter resource control settings on the
created machine at runtime.</para>
<para><function>RegisterMachine()</function> is similar to <function>CreateMachine()</function>.
However, it only registers a machine and does not create a scope unit for it. Instead, the caller's unit is
registered. We recommend to only use this method for container or VM managers that are run
multiple times, one instance for each container/VM they manage, and are invoked as system
services.</para>
<para><function>CreateMachineWithNetwork()</function> and
<function>RegisterMachineWithNetwork()</function> are similar to <function>CreateMachine()</function>
and <function>RegisterMachine()</function> but take an extra argument: an array of network interface
indices that point towards the virtual machine or container. The interface indices should reference one
or more network interfaces on the host that can be used to communicate with the guest. Commonly, the
passed interface index refers to the host side of a "veth" link (in case of containers), a
"tun"/"tap" link (in case of VMs), or the host side of a bridge interface that bridges access to the
VM/container interfaces. Specifying this information is useful to enable support for link-local IPv6
communication to the machines since the scope field of sockaddr_in6 can be initialized by the
specified ifindex.
<citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>
makes use of this information.</para>
<para><function>KillMachine()</function> sends a UNIX signal to the machine's processes. As its arguments, it takes a
machine name (as originally passed to <function>CreateMachine()</function> or returned by
<function>ListMachines()</function>), an identifier that specifies what precisely to send the signal to (either
<literal>leader</literal> or <literal>all</literal>), and a numeric UNIX signal integer.</para>
<para><function>TerminateMachine()</function> terminates a virtual machine, killing its processes. It
takes a machine name as its only argument.</para>
<para><function>GetMachineAddresses()</function> retrieves the IP addresses of a container. This call
returns an array of pairs consisting of an address family specifier (<constant>AF_INET</constant> or
<constant>AF_INET6</constant>) and a byte array containing the addresses. This is only supported for
containers that make use of network namespacing.</para>
<para><function>GetMachineOSRelease()</function> retrieves the OS release information of a
container. This method returns an array of key value pairs read from the
<citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> file in
the container and is useful to identify the operating system used in a container.</para>
<para><function>OpenMachinePTY()</function> allocates a pseudo TTY in the container and returns a file
descriptor and its path. This is equivalent to transitioning into the container and invoking
<citerefentry><refentrytitle>posix_openpt</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para><function>OpenMachineLogin()</function> allocates a pseudo TTY in the container and ensures that
a getty login prompt of the container is running on the other end. It returns the file descriptor of
the PTY and the PTY path. This is useful for acquiring a pty with a login prompt from the
container.</para>
<para><function>OpenMachineShell()</function> allocates a pseudo TTY in the container, as the specified
user, and invokes the executable at the specified path with a list of arguments (starting from
argv[0]) and an environment block. It then returns the file descriptor of the PTY and the PTY
path.</para>
<para><function>BindMountMachine()</function> bind mounts a file or directory from the host into the
container. Its arguments consist of a machine name, the source directory on the host, the destination directory in the
container, and two booleans, one indicating whether the bind mount shall be
read-only, the other indicating whether the destination mount point shall be created first, if it is
missing.</para>
<para><function>CopyFromMachine()</function> copies files or directories from a container into the
host. It takes a container name, a source directory in the container and a destination directory on the
host as arguments. <function>CopyToMachine()</function> does the opposite and copies files from a source
directory on the host into a destination directory in the container.</para>
<para><function>RemoveImage()</function> removes the image with the specified name.</para>
<para><function>RenameImage()</function> renames the specified image.</para>
<para><function>CloneImage()</function> clones the specified image under a new name. It also takes a
boolean argument indicating whether the resulting image shall be read-only or not.</para>
<para><function>MarkImageReadOnly()</function> toggles the read-only flag of an image.</para>
<para><function>SetPoolLimit()</function> sets an overall quota limit on the pool of images.</para>
<para><function>SetImageLimit()</function> sets a per-image quota limit.</para>
<para><function>MapFromMachineUser()</function>, <function>MapToMachineUser()</function>,
<function>MapFromMachineGroup()</function>, and <function>MapToMachineGroup()</function> may be used to map
UIDs/GIDs from the host user namespace to a container user namespace or vice versa.</para>
</refsect2>
<refsect2>
<title>Signals</title>
<para><function>MachineNew</function> and <function>MachineRemoved</function> are sent whenever a new
machine is registered or removed. These signals carry the machine name and the object path to the corresponding
<interfacename>org.freedesktop.machine1.Machine</interfacename> interface (see below).</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para><varname>PoolPath</varname> specifies the file system path where images are written to.</para>
<para><varname>PoolUsage</varname> specifies the current usage size of the image pool in bytes.</para>
<para><varname>PoolLimit</varname> specifies the size limit of the image pool in bytes.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Machine Objects</title>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.machine1 \
--object-path /org/freedesktop/machine1/machine/rawhide
node /org/freedesktop/machine1/machine/rawhide {
interface org.freedesktop.machine1.Machine {
methods:
Terminate();
Kill(in s who,
in i signal);
GetAddresses(out a(iay) addresses);
GetOSRelease(out a{ss} fields);
GetUIDShift(out u shift);
OpenPTY(out h pty,
out s pty_path);
OpenLogin(out h pty,
out s pty_path);
OpenShell(in s user,
in s path,
in as args,
in as environment,
out h pty,
out s pty_path);
BindMount(in s source,
in s destination,
in b read_only,
in b mkdir);
CopyFrom(in s source,
in s destination);
CopyTo(in s source,
in s destination);
OpenRootDirectory(out h fd);
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Name = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly ay Id = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t Timestamp = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t TimestampMonotonic = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Service = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Unit = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u Leader = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s Class = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s RootDirectory = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly ai NetworkInterfaces = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s State = '...';
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<refsect2>
<title>Methods</title>
<para><function>Terminate()</function> and <function>Kill()</function> terminate/kill the machine. These methods
take the same arguments as <function>TerminateMachine()</function> and
<function>KillMachine()</function> on the Manager interface, respectively.</para>
<para><function>GetAddresses()</function> and <function>GetOSRelease()</function> get the IP address and OS
release information from the machine. These methods take the same arguments as
<function>GetMachineAddresses()</function> and <function>GetMachineOSRelease()</function> of the
Manager interface, respectively.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para><varname>Name</varname> is the machine name as it was passed in during registration with
<function>CreateMachine()</function> on the manager object.</para>
<para><varname>Id</varname> is the machine UUID.</para>
<para><varname>Timestamp</varname> and <varname>TimestampMonotonic</varname> are the realtime and
monotonic timestamps when the virtual machines where created in microseconds since the epoch.</para>
<para><varname>Service</varname> contains a short string identifying the registering service as passed
in during registration of the machine.</para>
<para><varname>Unit</varname> is the systemd scope or service unit name for the machine.</para>
<para><varname>Leader</varname> is the PID of the leader process of the machine.</para>
<para><varname>Class</varname> is the class of the machine and is either the string "vm" (for real VMs
based on virtualized hardware) or "container" (for light-weight userspace virtualization sharing the
same kernel as the host).</para>
<para><varname>RootDirectory</varname> is the root directory of the container if it is known and
applicable or the empty string.</para>
<para><varname>NetworkInterfaces</varname> contains an array of network interface indices that point
towards the container, the VM or the host. For details about this information see the description of
<function>CreateMachineWithNetwork()</function> above.</para>
<para><varname>State</varname> is the state of the machine and is one of <literal>opening</literal>,
<literal>running</literal>, or <literal>closing</literal>. Note that the state machine is not considered
part of the API and states might be removed or added without this being considered API breakage.
</para>
</refsect2>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
</refentry>

View File

@ -1,666 +0,0 @@
<?xml version="1.0"?>
<!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % entities SYSTEM "custom-entities.ent" >
%entities;
]>
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.resolve1" conditional='ENABLE_RESOLVE'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.resolve1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.resolve1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.resolve1</refname>
<refpurpose>The D-Bus interface of systemd-resolved</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that provides hostname resolution and caching using DNS, LLMNR, and mDNS. It also
does DNSSEC validation. This page describes the resolve semantics and the D-Bus interface.</para>
<para>This page contains an API reference only. If you are looking for a longer explanation how to use
this API, please consult
<ulink url="https://wiki.freedesktop.org/www/Software/systemd/writing-network-configuration-managers">
Writing Network Configuration Managers</ulink> and
<ulink url="https://wiki.freedesktop.org/www/Software/systemd/writing-resolver-clients">Writing Resolver
Clients</ulink>.
</para>
</refsect1>
<refsect1>
<title>The Manager Object</title>
<para>The service exposes the following interfaces on the Manager object on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.resolve1 \
--object-path /org/freedesktop/resolve1
node /org/freedesktop/resolve1 {
interface org.freedesktop.resolve1.Manager {
methods:
ResolveHostname(in i ifindex,
in s name,
in i family,
in t flags,
out a(iiay) addresses,
out s canonical,
out t flags);
ResolveAddress(in i ifindex,
in i family,
in ay address,
in t flags,
out a(is) names,
out t flags);
ResolveRecord(in i ifindex,
in s name,
in q class,
in q type,
in t flags,
out a(iqqay) records,
out t flags);
ResolveService(in i ifindex,
in s name,
in s type,
in s domain,
in i family,
in t flags,
out a(qqqsa(iiay)s) srv_data,
out aay txt_data,
out s canonical_name,
out s canonical_type,
out s canonical_domain,
out t flags);
GetLink(in i ifindex,
out o path);
SetLinkDNS(in i ifindex,
in a(iay) addresses);
SetLinkDomains(in i ifindex,
in a(sb) domains);
SetLinkDefaultRoute(in i ifindex,
in b enable);
SetLinkLLMNR(in i ifindex,
in s mode);
SetLinkMulticastDNS(in i ifindex,
in s mode);
SetLinkDNSOverTLS(in i ifindex,
in s mode);
SetLinkDNSSEC(in i ifindex,
in s mode);
SetLinkDNSSECNegativeTrustAnchors(in i ifindex,
in as names);
RevertLink(in i ifindex);
RegisterService(in s name,
in s name_template,
in s type,
in q service_port,
in q service_priority,
in q serwise_weight,
in aa{say} txt_datas,
out o service_path);
UnregisterService(in o service_path);
ResetStatistics();
FlushCaches();
ResetServerFeatures();
properties:
readonly s LLMNRHostname = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s LLMNR = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s MulticastDNS = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s DNSOverTLS = '...';
readonly a(iiay) DNS = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly a(iiay) FallbackDNS = [...];
readonly (iiay) CurrentDNSServer = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(isb) Domains = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly (tt) TransactionStatistics = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly (ttt) CacheStatistics = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s DNSSEC = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly (tttt) DNSSECStatistics = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b DNSSECSupported = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly as DNSSECNegativeTrustAnchors = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s DNSStubListener = '...';
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--method SetLinkDefaultRoute is not documented!-->
<!--method SetLinkDNSOverTLS is not documented!-->
<!--method RegisterService is not documented!-->
<!--method UnregisterService is not documented!-->
<!--method FlushCaches is not documented!-->
<!--method ResetServerFeatures is not documented!-->
<!--property LLMNR is not documented!-->
<!--property MulticastDNS is not documented!-->
<!--property DNSOverTLS is not documented!-->
<!--property FallbackDNS is not documented!-->
<!--property CurrentDNSServer is not documented!-->
<!--property DNSSEC is not documented!-->
<!--property DNSSECNegativeTrustAnchors is not documented!-->
<!--property DNSStubListener is not documented!-->
<refsect2>
<title>Methods</title>
<para><function>ResolveHostname()</function> takes a hostname and resolves it to one or more IP addresses.
As parameters it takes the Linux network interface index to execute the query on, or 0 if it may be
done on any suitable interface. The <varname>name</varname> parameter specifies the hostname to
resolve. Note that if required, IDNA conversion is applied to this name unless it is resolved via LLMNR or MulticastDNS. The <varname>family</varname> parameter
limits the results to a specific address family. It may be <constant>AF_INET</constant>,
<constant>AF_INET6</constant> or <constant>AF_UNSPEC</constant>. If <constant>AF_UNSPEC</constant> is specified (recommended), both kinds are retrieved, subject
to local network configuration (i.e. if no local, routable IPv6 address is found, no IPv6 address is
retrieved; and similarly for IPv4). A 64-bit <varname>flags</varname> field may be used to alter the
behaviour of the resolver operation (see below). The method returns an array of address records. Each
address record consists of the interface index the address belongs to, an address family as well as a
byte array with the actual IP address data (which either has 4 or 16 elements, depending on the address
family). The returned address family will be one of <constant>AF_INET</constant> or
<constant>AF_INET6</constant>. For IPv6, the returned address interface index should be used to
initialize the .sin6_scope_id field of a <structname>struct sockaddr_in6</structname> instance to permit
support for resolution to link-local IP addresses. The address array is followed by the canonical name
of the host, which may or may not be identical to the resolved hostname. Finally, a 64-bit
<varname>flags</varname> field is returned that is defined similarly to the <varname>flags</varname>
field that was passed in, but contains information about the resolved data (see below). If the hostname
passed in is an IPv4 or IPv6 address formatted as string, it is parsed, and the result is returned. In
this case, no network communication is done.</para>
<para><function>ResolveAddress()</function> executes the reverse operation: it takes an IP address and
acquires one or more hostnames for it. As parameters it takes the interface index to execute the query
on, or <constant>0</constant> if all suitable interfaces are OK. The <varname>family</varname>
parameter indicates the address family of the IP address to resolve. It may be either
<constant>AF_INET</constant> or <constant>AF_INET6</constant>. The <varname>address</varname> parameter
takes the raw IP address data (as either a 4 or 16 byte array). The <varname>flags</varname> input
parameter may be used to alter the resolver operation (see below). The method returns an array of name
records, each consisting of an interface index and a hostname. The <varname>flags</varname> output
field contains additional information about the resolver operation (see below).</para>
<para><function>ResolveRecord()</function> takes a DNS resource record (RR) type, class and name, and
retrieves the full resource record set (RRset), including the RDATA, for it. As parameter it takes the
Linux network interface index to execute the query on, or <constant>0</constant> if it may be done on
any suitable interface. The <varname>name</varname> parameter specifies the RR domain name to look up
(no IDNA conversion is applied), followed by the 16-bit class and type fields (which may be
ANY). Finally, a <varname>flags</varname> field may be passed in to alter behaviour of the look-up (see
below). On completion, an array of RR items is returned. Each array entry consists of the network interface
index the RR was discovered on, the type and class field of the RR found, and a byte array of the raw
RR discovered. The raw RR data starts with the RR's domain name, in the original casing, followed
by the RR type, class, TTL and RDATA, in the binary format documented in
<ulink url="https://www.ietf.org/rfc/rfc1035.txt">RFC 1035</ulink>. For RRs that support name
compression in the payload (such as MX or PTR), the compression is expanded in the returned
data.</para>
<para>Note that currently, the class field has to be specified as IN or ANY. Specifying a different
class will return an error indicating that look-ups of this kind are unsupported. Similarly, some
special types are not supported either (AXFR, OPT, …). While <filename>systemd-resolved</filename> parses and validates resource
records of many types, it is crucial that clients using this API understand that the RR data originates
from the network and should be thoroughly validated before use.</para>
<para><function>ResolveService()</function> may be used to resolve a DNS SRV service record, as well as the
hostnames referenced in it, and possibly an accompanying DNS-SD TXT record containing additional
service metadata. The primary benefit of using this method over <function>ResolveRecord()</function>
specifying the SRV type is that it will resolve the SRV and TXT RRs as well as the hostnames referenced
in the SRV in a single operation. As parameters it takes a Linux network interface index, a service
name, a service type and a service domain. This method may be invoked in three different modes:</para>
<orderedlist>
<listitem><para>To resolve a DNS-SD service, specify the service name (e.g. <literal>Lennart's
Files</literal>), the service type (e.g. <literal>_webdav._tcp</literal>) and the domain to search in
(e.g. <literal>local</literal>) as the three service parameters. The service name must be in UTF-8
format, and no IDNA conversion is applied to it in this mode (as mandated by the DNS-SD
specifications). However, if necessary, IDNA conversion is applied to the domain parameter.</para>
</listitem>
<listitem><para>To resolve a plain SRV record, set the service name parameter to the empty string
and set the service type and domain properly. (IDNA conversion is applied to the domain, if
necessary.)</para></listitem>
<listitem><para>Alternatively, leave both the service name and type empty and specify the full
domain name of the SRV record (i.e. prefixed with the service type) in the domain parameter. (No IDNA
coversion is applied in this mode.)</para></listitem>
</orderedlist>
<para>The <varname>family</varname> parameter of the <function>ResolveService()</function> method encodes
the desired family of the addresses to resolve (use <constant>AF_INET</constant>,
<constant>AF_INET6</constant>, or <constant>AF_UNSPEC</constant>). If this is enabled (Use the
<constant>NO_ADDRESS</constant> flag to turn address resolution off, see below). The
<varname>flags</varname> parameter takes a couple of flags that may be used to alter the resolver
operation.</para>
<para>On completion, <function>ResolveService()</function> returns an array of SRV record structures. Each
items consisting of the priority, weight and port fields as well as the hostname to contact, as encoded in the SRV
record. Immediately following is an array of the addresses of this hostname, with each item consisting
of the interface index, the address family and the address data in a byte array. This address array is
followed by the canonicalized hostname. After this array of SRV record structures an array of byte
arrays follows that encodes the TXT RR strings, in case DNS-SD look-ups are enabled. The next parameters
are the canonical service name, type and domain. This may or may not be identical to the parameters
passed in. Finally, a <varname>flags</varname> field is returned that contains information about the
resolver operation performed.</para>
<para>The <function>ResetStatistics()</function> method resets the various statistics counters that
<filename>systemd-resolved</filename> maintains to zero. (For details, see the statistics properties below.)</para>
<para>The <function>GetLink()</function> method takes a network interface index and returns the object
path to the <interfacename>org.freedesktop.resolve1.Link</interfacename> object corresponding to it.
</para>
<para>The <function>SetLinkDNS()</function> method sets the DNS servers to use on a specific
interface. This method (and the following ones) may be used by network management software to configure
per-interface DNS settings. It takes a network interface index as well as an array of DNS server IP
address records. Each array item consists of an address family (either <constant>AF_INET</constant> or
<constant>AF_INET6</constant>), followed by a 4-byte or 16-byte array with the raw address data. This
method is a one-step shortcut for retrieving the Link object for a network interface using
<function>GetLink()</function> (see above) and then invoking the <function>SetDNS()</function> method
(see below) on it.
</para>
<para>Network management software integrating with <filename>systemd-resolved</filename> should
call this method (and the five below) after the interface appeared in the kernel (and thus after a
network interface index has been assigned), but before the network interfaces is activated
(<constant>IFF_UP</constant> set) so that all settings take effect during the full time the network
interface is up. It is safe to alter settings while the interface is up, however. Use
<function>RevertLink()</function> (described below) to reset all per-interface settings.</para>
<para>The <function>SetLinkDomains()</function> method sets the search and routing domains to use on a
specific network interface for DNS look-ups. It takes a network interface index and an array of domains,
each with a boolean parameter indicating whether the specified domain shall be used as a search domain
(false), or just as a routing domain (true). Search domains are used for qualifying single-label names into
FQDN when looking up hostnames, as well as for making routing decisions on which interface to send
queries ending in the domain to. Routing domains are only used for routing decisions and not used for single-label
name qualification. Pass the search domains in the order they should be used.</para>
<para>The <function>SetLinkLLMNR()</function> method enables or disables LLMNR support on a specific
network interface. It takes a network interface index as well as a string that may either be empty or one of
<literal>yes</literal>, <literal>no</literal> or <literal>resolve</literal>. If empty, the systemd-wide
default LLMNR setting is used. If <literal>yes</literal>, LLMNR is used for resolution of single-label
names and the local hostname is registered on all local LANs for LLMNR resolution by peers. If
<literal>no</literal>, LLMNR is turned off fully on this interface. If <literal>resolve</literal>, LLMNR
is only enabled for resolving names, but the local host name is not registered for other peers to
use.</para>
<para>Similarly, the <function>SetLinkMulticastDNS()</function> method enables or disables MulticastDNS
support on a specific interface. It takes the same parameters as <function>SetLinkLLMNR()</function>
described above.</para>
<para>The <function>SetLinkDNSSEC()</function> method enables or disables DNSSEC validation on a
specific network interface. It takes a network interface index as well as a string that may either be
empty or one of <literal>yes</literal>, <literal>no</literal>, or <literal>allow-downgrade</literal>. When
empty, the system-wide default DNSSEC setting is used. If <literal>yes</literal>, full DNSSEC validation
is done for all look-ups. If the selected DNS server does not support DNSSEC, look-ups will fail if this
mode is used. If <literal>no</literal>, DNSSEC validation is fully disabled. If
<literal>allow-downgrade</literal>, DNSSEC validation is enabled, but is turned off automatically if the
selected server does not support it (thus opening up behaviour to downgrade attacks). Note that DNSSEC
only applies to traditional DNS, not to LLMNR or MulticastDNS.</para>
<para>The <function>SetLinkDNSSECNegativeTrustAnchors()</function> method may be used to configure DNSSEC
Negative Trust Anchors (NTAs) for a specific network interface. It takes a network interface index and a
list of domains as arguments.</para>
<para>The <function>RevertLink()</function> method may be used to revert all per-link settings done with
the six methods described above to the defaults again.</para>
<refsect3>
<title>The Flags Parameter</title>
<para>The four methods above accept and return a 64-bit flags value. In most cases passing 0 is sufficient
and recommended. However, the following flags are defined to alter the look-up:</para>
<programlisting>
#define SD_RESOLVED_DNS (UINT64_C(1) &lt;&lt; 0)
#define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) &lt;&lt; 1)
#define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) &lt;&lt; 2)
#define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) &lt;&lt; 3)
#define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) &lt;&lt; 4)
#define SD_RESOLVED_NO_CNAME (UINT64_C(1) &lt;&lt; 5)
#define SD_RESOLVED_NO_TXT (UINT64_C(1) &lt;&lt; 6)
#define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) &lt;&lt; 7)
#define SD_RESOLVED_NO_SEARCH (UINT64_C(1) &lt;&lt; 8)
#define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) &lt;&lt; 9)
</programlisting>
<para>On input, the first five flags control the protocols to use for the look-up. They refer to
classic unicast DNS, LLMNR via IPv4/UDP and IPv6/UDP respectively, as well as MulticastDNS via
IPv4/UDP and IPv6/UDP. If all of these five bits are off on input (which is strongly recommended) the
look-up will be done via all suitable protocols for the specific look-up. Note that these flags
operate as filter only, but cannot force a look-up to be done via a protocol. Specifically, <filename>systemd-resolved</filename>
will only route look-ups within the .local TLD to MulticastDNS (plus some reverse look-up address
domains), and single-label names to LLMNR (plus some reverse address lookup domains). It will route
neither of these to Unicast DNS servers. Also, it will do LLMNR and Multicast DNS only on interfaces
suitable for multicast.</para>
<para>On output, these five flags indicate which protocol was used to execute the operation, and hence
where the data was found.</para>
<para>The primary use cases for these five flags are follow-up look-ups based on DNS data retrieved
earlier. In this case it is often a good idea to limit the follow-up look-up to the protocol that was
used to discover the first DNS result.</para>
<para>The NO_CNAME flag controls whether CNAME/DNAME resource records shall be followed during the
look-up. This flag is only available at input, none of the functions will return it on output. If a
CNAME/DNAME RR is discovered while resolving a hostname, an error is returned instead. By default,
when the flag is off, CNAME/DNAME RRs are followed.</para>
<para>The NO_TXT and NO_ADDRESS flags only influence operation of the
<function>ResolveService()</function> method. They are only defined for input, not output. If
NO_TXT set, the DNS-SD TXT RR look-up is not done in the same operation. If NO_ADDRESS is specified,
the hostnames discovered are not implicitly translated to their addresses.</para>
<para>The NO_SEARCH flag turns off the search domain logic. It is only defined for input in
<function>ResolveHostname()</function>. When specified, single-label hostnames are not qualified
using defined search domains, if any are configured. Note that <function>ResolveRecord()</function>
will never qualify single-label domain names using search domains. Also note that
multi-label hostnames are never subject to search list expansion.</para>
<para>The AUTHENTICATED bit is defined only in the output flags of the four functions. If set, the
returned data has been fully authenticated. Specifically, this bit is set for all DNSSEC-protected data
for which a full trust chain may be established to a trusted domain anchor. It is also set for locally
synthesized data, such as <literal>localhost</literal> or data from
<filename>/etc/hosts</filename>. Moreover, it is set for all LLMNR or mDNS RRs which originate from the
local host. Applications that require authenticated RR data for operation should check this flag before
trusting the data. Note that <filename>systemd-resolved</filename> will never return invalidated data, hence this flag
simply allows to discern the cases where data is known to be trustable, or where there is proof that
the data is "rightfully" unauthenticated (which includes cases where the underlying protocol or server
does not support authenticating data).</para>
</refsect3>
</refsect2>
<refsect2>
<title>Properties</title>
<varname>LLMNRHostname</varname> contains the hostname currently exposed on the network via LLMNR. It
usually follows the system hostname as may be queried via
<citerefentry project="man-pages"><refentrytitle>gethostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
but may differ if a conflict is detected on the network.
<para><varname>DNS</varname> contains an array of all DNS servers currently used by
<filename>systemd-resolved</filename>. It contains similar information as the DNS server data written to
/run/systemd/resolve/resolv.conf. Each structure in the array consists of a numeric network interface
index, an address family, and a byte array containing the DNS server address (either 4 bytes in length
for IPv4 or 16 bytes in lengths for IPv6). The array contains DNS servers configured system-wide,
including those possibly read from a foreign <filename>/etc/resolv.conf</filename> or the
<varname>DNS=</varname> setting in <filename>/etc/systemd/resolved.conf</filename>, as well as
per-interface DNS server information either retrieved from
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
or configured by external software via <function>SetLinkDNS()</function> (see above). The network
interface index will be 0 for the system-wide configured services and non-zero for the per-link
servers.</para>
<para>Similarly, the <varname>Domains</varname> property contains an array of all search and
routing domains currently used by <filename>systemd-resolved</filename>. Each entry consists of a network interface index (again, 0
encodes system-wide entries), the actual domain name, and whether the entry is used only for routing
(true) or for both routing and searching (false).</para>
<para>The <varname>TransactionStatistics</varname> property contains information about the number of
transactions <filename>systemd-resolved</filename> has processed. It contains a pair of unsigned 64-bit counters, the first
containing the number of currently ongoing transactions, the second the number of total transactions
<filename>systemd-resolved</filename> is processing or has processed. The latter value may be reset using the
<function>ResetStatistics()</function> method described above. Note that the number of transactions does
not directly map to the number of issued resolver bus method calls. While simple look-ups usually require a
single transaction only, more complex look-ups might result in more, for example when CNAMEs or DNSSEC
are in use.</para>
<para>The <varname>CacheStatistics</varname> property contains information about the executed cache
operations so far. It exposes three 64-bit counters: the first being the total number of current cache
entries (both positive and negative), the second the number of cache hits, and the third the number of
cache misses. The latter counters may be reset using <function>ResetStatistics()</function> (see
above). </para>
<para>The <varname>DNSSECStatistics</varname> property contains information about the DNSSEC
validations executed so far. It contains four 64-bit counters: the number of secure, insecure, bogus,
and indeterminate DNSSEC validations so far. The counters are increased for each validated RRset, and
each non-existance proof. The secure counter is increased for each operation that successfully verified
a signed reply, the insecure counter is increased for each operation that successfully verified that an
unsigned reply is rightfully unsigned. The bogus counter is increased for each operation where the
validation did not check out and the data is likely to have been tempered with. Finally the
indeterminate counter is increased for each operation which did not complete because the necessary keys
could not be acquired or the cryptographic algorithms were unknown.</para>
<para>The <varname>DNSSECSupported</varname> boolean property reports whether DNSSEC is enabled and
the selected DNS servers support it. It combines information about system-wide and per-link DNS
settings (see below), and only reports true if DNSSEC is enabled and supported on every interface for
which DNS is configured and for the system-wide settings if there are any. Note that <filename>systemd-resolved</filename> assumes
DNSSEC is supported by DNS servers until it verifies that this is not the case. Thus, the reported
value may initially be true, until the first transactions are executed.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Link Object</title>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.resolve1 \
--object-path /org/freedesktop/resolve1/link/_34
node /org/freedesktop/resolve1/link/_34 {
interface org.freedesktop.resolve1.Link {
methods:
SetDNS(in a(iay) addresses);
SetDomains(in a(sb) domains);
SetDefaultRoute(in b enable);
SetLLMNR(in s mode);
SetMulticastDNS(in s mode);
SetDNSOverTLS(in s mode);
SetDNSSEC(in s mode);
SetDNSSECNegativeTrustAnchors(in as names);
Revert();
properties:
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t ScopesMask = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(iay) DNS = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly (iay) CurrentDNSServer = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(sb) Domains = [...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b DefaultRoute = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s LLMNR = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s MulticastDNS = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s DNSOverTLS = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s DNSSEC = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly as DNSSECNegativeTrustAnchors = ['...', ...];
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b DNSSECSupported = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--method SetDomains is not documented!-->
<!--method SetDefaultRoute is not documented!-->
<!--method SetLLMNR is not documented!-->
<!--method SetMulticastDNS is not documented!-->
<!--method SetDNSOverTLS is not documented!-->
<!--method SetDNSSEC is not documented!-->
<!--method SetDNSSECNegativeTrustAnchors is not documented!-->
<!--method Revert is not documented!-->
<!--property CurrentDNSServer is not documented!-->
<!--property DefaultRoute is not documented!-->
<!--property LLMNR is not documented!-->
<!--property MulticastDNS is not documented!-->
<!--property DNSOverTLS is not documented!-->
<!--property DNSSEC is not documented!-->
<!--property DNSSECNegativeTrustAnchors is not documented!-->
<para>For each Linux network interface a "Link" object is created which exposes per-link DNS
configuration and state. Use <function>GetLink()</function> on the Manager interface to retrieve the
object path for a link object given the network interface index (see above).</para>
<refsect2>
<title>Methods</title>
<para>The various methods exposed by the Link interface are equivalent to their similarly named
counterparts on the Manager interface. e.g. <function>SetDNS()</function> on the Link object maps to
<function>SetLinkDNS()</function> on the Manager object, the main difference being that the later
expects an interface index to be specified. Invoking the methods on the Manager interface has the
benefit of reducing roundtrips, as it is not necessary to first request the Link object path via
<function>GetLink()</function> before invoking the methods. For further details on these methods see
the <interfacename>Manager</interfacename> documentation above.</para>
</refsect2>
<refsect2>
<title>Properties</title>
<para><varname>ScopesMask</varname> defines which resolver scopes are currently active on this
interface. This 64-bit unsigned integer field is a bit mask consisting of a subset of the bits of the
flags parameter describe above. Specifically, it may have the DNS, LLMNR and MDNS bits (the latter in
IPv4 and IPv6 flavours) set. Each individual bit is set when the protocol applies to a specific
interface and is enabled for it. It is unset otherwise. Specifically, a multicast-capable interface in
the "UP" state with an IP address is suitable for LLMNR or MulticastDNS, and any interface that is UP and
has an IP address is suitable for DNS. Note the relationship of the bits exposed here with the LLMNR
and MulticastDNS properties also exposed on the Link interface. The latter expose what is *configured*
to be used on the interface, the former expose what is actually used on the interface, taking into
account the abilities of the interface.</para>
<para><varname>DNSSECSupported</varname> exposes a boolean field that indicates whether DNSSEC is
currently configured and in use on the interface. Note that if DNSSEC is enabled on an interface, it is
assumed available until it is detected that the configured server does not actually support it. Thus,
this property may initially report that DNSSEC is supported on an interface.</para>
<para>The other properties reflect the state of the various configuration settings for the link which
may be set with the various methods calls such as SetDNS() or SetLLMNR().</para>
</refsect2>
</refsect1>
<refsect1>
<title>Common Errors</title>
<para>Many bus methods <filename>systemd-resolved</filename> exposes (in particular the resolver methods such
as <function>ResolveHostname()</function> on the <interfacename>Manager</interfacename> interface) may return
some of the following errors:</para>
<variablelist>
<varlistentry><term><constant>org.freedesktop.resolve1.NoNameServers</constant></term>
<listitem><para>No suitable DNS servers were found to resolve a request.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.InvalidReply</constant></term>
<listitem><para>A response from the selected DNS server was not understood.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.NoSuchRR</constant></term>
<listitem><para>The requested name exists, but there is no resource record of the requested type for
it. (This is the DNS NODATA case).</para></listitem></varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.CNameLoop</constant></term>
<listitem><para>The look-up failed because a CNAME or DNAME loop was detected.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.Aborted</constant></term>
<listitem><para>The look-up was aborted because the selected protocol became unavailable while the
operation was ongoing.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.NoSuchService</constant></term>
<listitem><para>A service look-up was successful, but the SRV record reported that the service is not
available.</para></listitem></varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.DnssecFailed</constant></term>
<listitem><para>The acquired response did not pass DNSSEC validation.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.NoTrustAnchor</constant></term>
<listitem><para>No chain of trust could be established for the response to a configured DNSSEC trust
anchor.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.ResourceRecordTypeUnsupported</constant></term>
<listitem><para>The requested resource record type is not supported on the selected DNS servers. This
error is generated for example when an RRSIG record is requested from a DNS server that does not
support DNSSEC.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.NoSuchLink</constant></term>
<listitem><para>No network interface with the specified network interface index exists.
</para></listitem></varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.LinkBusy</constant></term>
<listitem><para>The requested configuration change could not be made because
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
already took possession of the interface and supplied configuration data for it.</para></listitem>
</varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.NetworkDown</constant></term>
<listitem><para>The requested look-up failed because the system is currently not connected to any
suitable network.</para></listitem></varlistentry>
<varlistentry><term><constant>org.freedesktop.resolve1.DnsError.NXDOMAIN</constant></term>
<term><constant>org.freedesktop.resolve1.DnsError.REFUSED</constant></term>
<term>...</term>
<listitem><para>The look-up failed with a DNS return code reporting a failure. The error names used as
suffixes here are defined in by IANA in
<ulink url="https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODEs</ulink>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
</refentry>

File diff suppressed because it is too large Load Diff

View File

@ -1,153 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="org.freedesktop.timedate1" conditional='ENABLE_TIMEDATED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>org.freedesktop.timedate1</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>org.freedesktop.timedate1</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>org.freedesktop.timedate1</refname>
<refpurpose>The D-Bus interface of systemd-timedated</refpurpose>
</refnamediv>
<refsect1>
<title>Introduction</title>
<para>
<citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is a system service that can be used to control the system time and related settings. This page
describes the D-Bus interface.</para>
</refsect1>
<refsect1>
<title>The D-Bus API</title>
<para>The service exposes the following interfaces on the bus:</para>
<programlisting>
$ gdbus introspect --system \
--dest org.freedesktop.timedate1 \
--object-path /org/freedesktop/timedate1
node /org/freedesktop/timedate1 {
interface org.freedesktop.timedate1 {
methods:
SetTime(in x usec_utc,
in b relative,
in b interactive);
SetTimezone(in s timezone,
in b interactive);
SetLocalRTC(in b local_rtc,
in b fix_system,
in b interactive);
SetNTP(in b use_ntp,
in b interactive);
ListTimezones(out as timezones);
properties:
readonly s Timezone = '...';
readonly b LocalRTC = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b CanNTP = ...;
readonly b NTP = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b NTPSynchronized = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t TimeUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t RTCTimeUSec = ...;
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
};
</programlisting>
<!--method ListTimezones is not documented!-->
<!--property Timezone is not documented!-->
<!--property LocalRTC is not documented!-->
<!--property CanNTP is not documented!-->
<!--property NTP is not documented!-->
<!--property NTPSynchronized is not documented!-->
<!--property TimeUSec is not documented!-->
<!--property RTCTimeUSec is not documented!-->
<refsect2>
<title>Methods</title>
<para>Use <function>SetTime()</function> to change the system clock. Pass a value of microseconds since
the UNIX epoch (1 Jan 1970 UTC). If <varname>relative</varname> is true, the passed usec value will be
added to the current system time. If it is false, the current system time will be set to the passed usec
value. If the system time is set with this method, the RTC will be updated as well.</para>
<para>Use <function>SetTimezone()</function> to set the system timezone. Pass a value like
<literal>Europe/Berlin</literal> to set the timezone. Valid timezones are listed in
<filename>/usr/share/zoneinfo/zone.tab</filename>. If the RTC is configured to be maintained in local
time, it will be updated accordingly.</para>
<para>Use <function>SetLocalRTC()</function> to control whether the RTC is in local time or UTC. It is
strongly recommended to maintain the RTC in UTC. However, some OSes (Windows) maintain the RTC in local
time, which might make it necessary to enable this feature. Note that this might create various problems as
daylight changes could be missed. If <varname>fix_system</varname> is <literal>true</literal>,
the time from the RTC is read again and the system clock is adjusted according to the new setting. If
<varname>fix_system</varname> is <literal>false</literal>, the system time is written to the RTC
taking the new setting into account. Use <varname>fix_system=true</varname> in installers and livecds
where the RTC is probably more reliable than the system time. Use <varname>fix_system=false</varname>
in configuration UIs that are run during normal operation and where the system clock is probably more
reliable than the RTC.</para>
<para>Use <function>SetNTP()</function> to control whether the system clock is synchronized with the
network using <filename>systemd-timesyncd</filename>. This will enable and start or disable and stop
the chosen time synchronization service.</para>
<para>Whenever the timezone and local_rtc settings are changed via the daemon,
<function>PropertyChanged</function> signals are sent out to which clients can subscribe. Changing the
time settings using this interface is authenticated via PolicyKit.</para>
<para>Note that this service will not inform you about system time changes. Use
<citerefentry project="man-pages"><refentrytitle>timerfd</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with <constant>CLOCK_REALTIME</constant> and <constant>TFD_TIMER_CANCEL_ON_SET</constant> for that.
</para>
<para>The <varname>user_interaction</varname> boolean parameters can be used to control whether
PolicyKit should interactively ask the user for authentication credentials if required.</para>
<para>The PolicyKit action for <function>SetTimezone()</function> is
<interfacename>org.freedesktop.timedate1.set-timezone</interfacename>. For
<function>SetLocalRTC()</function> it is
<interfacename>org.freedesktop.timedate1.set-local-rtc</interfacename>, for
<function>SetTime()</function> it is <interfacename>org.freedesktop.timedate1.set-time</interfacename>
and for <function>SetNTP()</function> it is
<interfacename>org.freedesktop.timedate1.set-ntp</interfacename>.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Versioning</title>
<para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
the usual interface versioning guidelines</ulink>.</para>
</refsect1>
<refsect1>
<title>See also</title>
<para><ulink url="https://lists.freedesktop.org/archives/systemd-devel/2011-May/002526.html">More information on how the system clock and RTC interact</ulink></para>
</refsect1>
</refentry>

View File

@ -44,14 +44,6 @@ manpages = [
['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_NSS_MYMACHINES'], ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_NSS_MYMACHINES'],
['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_NSS_RESOLVE'], ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_NSS_RESOLVE'],
['nss-systemd', '8', ['libnss_systemd.so.2'], 'ENABLE_NSS_SYSTEMD'], ['nss-systemd', '8', ['libnss_systemd.so.2'], 'ENABLE_NSS_SYSTEMD'],
['org.freedesktop.hostname1', '5', [], 'ENABLE_HOSTNAMED'],
['org.freedesktop.import1', '5', [], 'ENABLE_IMPORTD'],
['org.freedesktop.locale1', '5', [], 'ENABLE_LOCALED'],
['org.freedesktop.login1', '5', [], 'ENABLE_LOGIND'],
['org.freedesktop.machine1', '5', [], 'ENABLE_MACHINED'],
['org.freedesktop.resolve1', '5', [], 'ENABLE_RESOLVE'],
['org.freedesktop.systemd1', '5', [], ''],
['org.freedesktop.timedate1', '5', [], 'ENABLE_TIMEDATED'],
['os-release', '5', [], ''], ['os-release', '5', [], ''],
['pam_systemd', '8', [], 'HAVE_PAM'], ['pam_systemd', '8', [], 'HAVE_PAM'],
['pam_systemd_home', '8', [], 'ENABLE_PAM_HOME'], ['pam_systemd_home', '8', [], 'ENABLE_PAM_HOME'],

View File

@ -18,7 +18,7 @@
<refnamediv> <refnamediv>
<refname>systemd-hostnamed.service</refname> <refname>systemd-hostnamed.service</refname>
<refname>systemd-hostnamed</refname> <refname>systemd-hostnamed</refname>
<refpurpose>Daemon to control system hostname from programs</refpurpose> <refpurpose>Host name bus mechanism</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
@ -29,35 +29,19 @@
<refsect1> <refsect1>
<title>Description</title> <title>Description</title>
<para><filename>systemd-hostnamed.service</filename> is a system service that may be used to change the <para><filename>systemd-hostnamed</filename> is a system service
system's hostname and related machine metadata from user programs. It is automatically activated on that may be used as a mechanism to change the system's hostname.
request and terminates itself when unused.</para> <filename>systemd-hostnamed</filename> is automatically activated
on request and terminates itself when it is unused.</para>
<para>It currently offers access to five variables:
<itemizedlist>
<listitem><para>The current hostname (Example: <literal>dhcp-192-168-47-11</literal>)</para>
</listitem>
<listitem><para>The static (configured) hostname (Example:
<literal>lennarts-computer</literal>)</para></listitem>
<listitem><para>The pretty hostname (Example: <literal>Lennart's Computer</literal>)</para>
</listitem>
<listitem><para>A suitable icon name for the local host (Example:
<literal>computer-laptop</literal>)</para></listitem>
<listitem><para>A chassis type (Example: <literal>tablet</literal>)</para>
</listitem>
</itemizedlist></para>
<para>The tool <para>The tool
<citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
is a command line client to this service.</para> is a command line client to this service.</para>
<para>See <para>See the <ulink
<citerefentry><refentrytitle>org.freedesktop.hostname1</refentrytitle><manvolnum>1</manvolnum></citerefentry> url="https://www.freedesktop.org/wiki/Software/systemd/hostnamed">
for a description of the D-Bus API.</para> developer documentation</ulink> for information about the APIs
<filename>systemd-hostnamed</filename> provides.</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -29,7 +29,7 @@
<refsect1> <refsect1>
<title>Description</title> <title>Description</title>
<para><filename>systemd-localed.service</filename> is a system service <para><filename>systemd-localed</filename> is a system service
that may be used as mechanism to change the system locale that may be used as mechanism to change the system locale
settings, as well as the console key mapping and default X11 key settings, as well as the console key mapping and default X11 key
mapping. <filename>systemd-localed</filename> is automatically mapping. <filename>systemd-localed</filename> is automatically
@ -40,9 +40,10 @@
<citerefentry project='man-pages'><refentrytitle>localectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> <citerefentry project='man-pages'><refentrytitle>localectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
is a command line client to this service.</para> is a command line client to this service.</para>
<para>See <para>See the <ulink
<citerefentry><refentrytitle>org.freedesktop.locale1</refentrytitle><manvolnum>1</manvolnum></citerefentry> url="https://www.freedesktop.org/wiki/Software/systemd/localed">
for a description of the D-Bus API.</para> developer documentation</ulink> for information about the APIs
<filename>systemd-localed</filename> provides.</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -78,20 +78,14 @@
for information about the basic concepts of logind for information about the basic concepts of logind
such as users, sessions and seats.</para> such as users, sessions and seats.</para>
<para>See <para>See the <ulink
<citerefentry><refentrytitle>org.freedesktop.login1</refentrytitle><manvolnum>3</manvolnum></citerefentry> url="https://www.freedesktop.org/wiki/Software/systemd/logind">
for information about the D-Bus APIs <filename>systemd-logind</filename> provides.</para> logind D-Bus API Documentation</ulink> for information about the
APIs <filename>systemd-logind</filename> provides.</para>
<para>For more information on the inhibition logic see the <ulink <para>For more information on the inhibition logic see the <ulink
url="https://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor url="https://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor
Lock Developer Documentation</ulink>.</para> Lock Developer Documentation</ulink>.</para>
<para>If you are interested in writing a display manager that makes use of logind, please have look at
<ulink url="https://www.freedesktop.org/wiki/Software/systemd/writing-display-managers">Writing Display
Managers</ulink>.
If you are interested in writing a desktop environment that makes use of logind, please have look at
<ulink url="http://www.freedesktop.org/wiki/Software/systemd/writing-desktop-environments">Writing
Desktop Environments</ulink>.</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -29,91 +29,24 @@
<refsect1> <refsect1>
<title>Description</title> <title>Description</title>
<para><command>systemd-machined</command> is a system service that keeps track of locally running virtual <para><command>systemd-machined</command> is a system service that
machines and containers.</para> keeps track of virtual machines and containers, and processes
belonging to them.</para>
<para><command>systemd-machined</command> is useful for registering and keeping track of both OS
containers (containers that share the host kernel but run a full init system of their own and behave in
most regards like a full virtual operating system rather than just one virtualized app) and full virtual
machines (virtualized hardware running normal operating systems and possibly different kernels).</para>
<para><command>systemd-machined</command> should <emphasis>not</emphasis> be used for registering/keeping
track of application sandbox containers. A <emphasis>machine</emphasis> in the context of
<command>systemd-machined</command> is supposed to be an abstract term covering both OS containers and
full virtual machines, but not application sandboxes.</para>
<para>Machines registered with machined are exposed in various ways in the system. For example:
<itemizedlist>
<listitem><para>Tools like
<citerefentry project='man-pages'><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry>
will show to which machine a specific process belongs in a column of
its own, and so will
<ulink url="https://help.gnome.org/users/gnome-system-monitor/">gnome-system-monitor</ulink> or
<citerefentry><refentrytitle>systemd-cgls</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
</listitem>
<listitem><para>systemd's various tools
(<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>localectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, ...)
support the <option>-M</option> switch to operate on local containers instead of the host system.
</para></listitem>
<listitem><para><command>systemctl list-machines</command> will show the system state of all local
containers, connecting to the container's init system for that.</para></listitem>
<listitem><para>systemctl's <option>--recursive</option> switch has the effect of not only showing the
locally running services, but recursively showing the services of all registered containers.</para></listitem>
<listitem><para>The <command>machinectl</command> command provides access to a number of useful
operations on registered containers, such as introspecting them, rebooting, shutting them down, and
getting a login prompt on them.</para></listitem>
<listitem><para>The
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry> library
exposes the
<citerefentry><refentrytitle>sd_bus_open_system_container</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call to connect to the system bus of any registered container.</para></listitem>
<listitem><para>The
<citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>
module makes sure all registered containers can be resolved via normal glibc
<citerefentry project='man-pages'><refentrytitle>gethostbyname</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or
<citerefentry project='man-pages'><refentrytitle>getaddrinfo</refentrytitle><manvolnum>3</manvolnum></citerefentry>
calls.</para></listitem>
</itemizedlist></para>
<para>See <para>See
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for some examples on how to run containers with OS tools.</para> for some examples on how to run containers with OS tools.</para>
<para>If you are interested in writing a VM or container manager that makes use of machined, please have <para>Use
look at <ulink url="https://www.freedesktop.org/wiki/Software/systemd/writing-vm-managers">Writing <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>
Virtual Machine or Container Managers</ulink>. Also see the <ulink to make the names of local containers known to
url="https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New Control Group <command>systemd-machined</command> locally resolvable as host
Interfaces</ulink>.</para> names.</para>
<para>The daemon provides both a C library interface <para>See the
(which is shared with <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>) <ulink url="https://www.freedesktop.org/wiki/Software/systemd/machined">
as well as a D-Bus interface. machined D-Bus API Documentation</ulink> for information about the
The library interface may be used to introspect and watch the state of virtual machines/containers. APIs <filename>systemd-machined</filename> provides.</para>
The bus interface provides the same but in addition may also be used to register or terminate
machines.
For more information please consult
<citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>org.freedesktop.machine1</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para>A small companion daemon
<citerefentry><refentrytitle>systemd-importd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is also available, which implements importing, exporting, and downloading of container and VM images.
</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -34,12 +34,11 @@
resolver and responder. Local applications may submit network name resolution requests via three interfaces:</para> resolver and responder. Local applications may submit network name resolution requests via three interfaces:</para>
<itemizedlist> <itemizedlist>
<listitem><para>The native, fully-featured API <command>systemd-resolved</command> exposes on the bus, <listitem><para>The native, fully-featured API <command>systemd-resolved</command> exposes on the bus. See the
see <ulink url="https://www.freedesktop.org/wiki/Software/systemd/resolved">API Documentation</ulink> for
<citerefentry><refentrytitle>org.freedesktop.resolve1</refentrytitle><manvolnum>5</manvolnum></citerefentry> details. Usage of this API is generally recommended to clients as it is asynchronous and fully featured (for
for details. Usage of this API is generally recommended to clients as it is asynchronous and fully example, properly returns DNSSEC validation status and interface scope for addresses as necessary for supporting
featured (for example, properly returns DNSSEC validation status and interface scope for addresses as link-local networking).</para></listitem>
necessary for supporting link-local networking).</para></listitem>
<listitem><para>The glibc <listitem><para>The glibc
<citerefentry project='man-pages'><refentrytitle>getaddrinfo</refentrytitle><manvolnum>3</manvolnum></citerefentry> API as defined <citerefentry project='man-pages'><refentrytitle>getaddrinfo</refentrytitle><manvolnum>3</manvolnum></citerefentry> API as defined

View File

@ -29,7 +29,7 @@
<refsect1> <refsect1>
<title>Description</title> <title>Description</title>
<para><filename>systemd-timedated.service</filename> is a system service <para><filename>systemd-timedated</filename> is a system service
that may be used as a mechanism to change the system clock and that may be used as a mechanism to change the system clock and
timezone, as well as to enable/disable network time synchronization. timezone, as well as to enable/disable network time synchronization.
<filename>systemd-timedated</filename> is automatically activated <filename>systemd-timedated</filename> is automatically activated
@ -39,23 +39,10 @@
<citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> <citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
is a command line client to this service.</para> is a command line client to this service.</para>
<para><filename>systemd-timedated</filename> currently offers access to <para>See the <ulink
the following four settings: url="https://www.freedesktop.org/wiki/Software/systemd/timedated">
<itemizedlist> developer documentation</ulink> for information about the APIs
<listitem><para>The system time</para></listitem> <filename>systemd-timedated</filename> provides.</para>
<listitem><para>The system timezone</para></listitem>
<listitem><para>A boolean controlling whether the system RTC is in local or UTC
timezone</para></listitem>
<listitem><para>Whether the time synchronization service is enabled/started or
disabled/stopped, see next section.</para></listitem>
</itemizedlist></para>
<para>See
<citerefentry><refentrytitle>org.freedesktop.timedate1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for information about the D-Bus API.</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -280,9 +280,6 @@
files or parameters passed on the kernel command line. For details, see files or parameters passed on the kernel command line. For details, see
<citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
<para>The D-Bus API of <command>systemd</command> is described in
<citerefentry><refentrytitle>org.freedesktop.systemd1</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
<para>Systems which invoke systemd in a container or initrd environment should implement the <ulink <para>Systems which invoke systemd in a container or initrd environment should implement the <ulink
url="https://systemd.io/CONTAINER_INTERFACE">Container Interface</ulink> or <ulink url="https://systemd.io/CONTAINER_INTERFACE">Container Interface</ulink> or <ulink
url="https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface">initrd Interface</ulink> url="https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface">initrd Interface</ulink>
@ -1255,7 +1252,6 @@
<citerefentry><refentrytitle>systemd-notify</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemd-notify</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>, <citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>org.freedesktop.systemd1</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>,

View File

@ -118,21 +118,9 @@ int bus_job_method_get_waiting_jobs(sd_bus_message *message, void *userdata, sd_
const sd_bus_vtable bus_job_vtable[] = { const sd_bus_vtable bus_job_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_METHOD("Cancel", NULL, NULL, bus_job_method_cancel, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Cancel", NULL, NULL, bus_job_method_cancel, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetAfter", SD_BUS_METHOD("GetAfter", NULL, "a(usssoo)", bus_job_method_get_waiting_jobs, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("GetBefore", NULL, "a(usssoo)", bus_job_method_get_waiting_jobs, SD_BUS_VTABLE_UNPRIVILEGED),
"a(usssoo)",
SD_BUS_PARAM(jobs),
bus_job_method_get_waiting_jobs,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetBefore",
NULL,,
"a(usssoo)",
SD_BUS_PARAM(jobs),
bus_job_method_get_waiting_jobs,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PROPERTY("Id", "u", NULL, offsetof(Job, id), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Id", "u", NULL, offsetof(Job, id), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Unit", "(so)", property_get_unit, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Unit", "(so)", property_get_unit, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("JobType", "s", property_get_type, offsetof(Job, type), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("JobType", "s", property_get_type, offsetof(Job, type), SD_BUS_VTABLE_PROPERTY_CONST),

View File

@ -2477,569 +2477,87 @@ const sd_bus_vtable bus_manager_vtable[] = {
SD_BUS_PROPERTY("TimerSlackNSec", "t", property_get_timer_slack_nsec, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("TimerSlackNSec", "t", property_get_timer_slack_nsec, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultOOMPolicy", "s", bus_property_get_oom_policy, offsetof(Manager, default_oom_policy), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultOOMPolicy", "s", bus_property_get_oom_policy, offsetof(Manager, default_oom_policy), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD_WITH_NAMES("GetUnit", SD_BUS_METHOD("GetUnit", "s", "o", method_get_unit, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("GetUnitByPID", "u", "o", method_get_unit_by_pid, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name), SD_BUS_METHOD("GetUnitByInvocationID", "ay", "o", method_get_unit_by_invocation_id, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("GetUnitByControlGroup", "s", "o", method_get_unit_by_control_group, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(unit), SD_BUS_METHOD("LoadUnit", "s", "o", method_load_unit, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_unit, SD_BUS_METHOD("StartUnit", "ss", "o", method_start_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("StartUnitReplace", "sss", "o", method_start_unit_replace, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitByPID", SD_BUS_METHOD("StopUnit", "ss", "o", method_stop_unit, SD_BUS_VTABLE_UNPRIVILEGED),
"u", SD_BUS_METHOD("ReloadUnit", "ss", "o", method_reload_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(pid), SD_BUS_METHOD("RestartUnit", "ss", "o", method_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("TryRestartUnit", "ss", "o", method_try_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(unit), SD_BUS_METHOD("ReloadOrRestartUnit", "ss", "o", method_reload_or_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_unit_by_pid, SD_BUS_METHOD("ReloadOrTryRestartUnit", "ss", "o", method_reload_or_try_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("EnqueueUnitJob", "sss", "uososa(uosos)", method_enqueue_unit_job, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitByInvocationID", SD_BUS_METHOD("KillUnit", "ssi", NULL, method_kill_unit, SD_BUS_VTABLE_UNPRIVILEGED),
"ay", SD_BUS_METHOD("CleanUnit", "sas", NULL, method_clean_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(invocation_id), SD_BUS_METHOD("ResetFailedUnit", "s", NULL, method_reset_failed_unit, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("SetUnitProperties", "sba(sv)", NULL, method_set_unit_properties, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(unit), SD_BUS_METHOD("RefUnit", "s", NULL, method_ref_unit, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_unit_by_invocation_id, SD_BUS_METHOD("UnrefUnit", "s", NULL, method_unref_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("StartTransientUnit", "ssa(sv)a(sa(sv))", "o", method_start_transient_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitByControlGroup", SD_BUS_METHOD("GetUnitProcesses", "s", "a(sus)", method_get_unit_processes, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("AttachProcessesToUnit", "ssau", NULL, method_attach_processes_to_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(cgroup), SD_BUS_METHOD("AbandonScope", "s", NULL, method_abandon_scope, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("GetJob", "u", "o", method_get_job, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(unit), SD_BUS_METHOD("GetJobAfter", "u", "a(usssoo)", method_get_job_waiting, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_unit_by_control_group, SD_BUS_METHOD("GetJobBefore", "u", "a(usssoo)", method_get_job_waiting, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("CancelJob", "u", NULL, method_cancel_job, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("LoadUnit", SD_BUS_METHOD("ClearJobs", NULL, NULL, method_clear_jobs, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("ResetFailed", NULL, NULL, method_reset_failed, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name), SD_BUS_METHOD("ListUnits", NULL, "a(ssssssouso)", method_list_units, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("ListUnitsFiltered", "as", "a(ssssssouso)", method_list_units_filtered, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(unit), SD_BUS_METHOD("ListUnitsByPatterns", "asas", "a(ssssssouso)", method_list_units_by_patterns, SD_BUS_VTABLE_UNPRIVILEGED),
method_load_unit, SD_BUS_METHOD("ListUnitsByNames", "as", "a(ssssssouso)", method_list_units_by_names, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListJobs", NULL, "a(usssoo)", method_list_jobs, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("StartUnit", SD_BUS_METHOD("Subscribe", NULL, NULL, method_subscribe, SD_BUS_VTABLE_UNPRIVILEGED),
"ss", SD_BUS_METHOD("Unsubscribe", NULL, NULL, method_unsubscribe, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name) SD_BUS_METHOD("Dump", NULL, "s", method_dump, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("DumpByFileDescriptor", NULL, "h", method_dump_by_fd, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("CreateSnapshot", "sb", "o", method_refuse_snapshot, SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_HIDDEN),
SD_BUS_PARAM(job), SD_BUS_METHOD("RemoveSnapshot", "s", NULL, method_refuse_snapshot, SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_HIDDEN),
method_start_unit, SD_BUS_METHOD("Reload", NULL, NULL, method_reload, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Reexecute", NULL, NULL, method_reexecute, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("StartUnitReplace", SD_BUS_METHOD("Exit", NULL, NULL, method_exit, 0),
"sss", SD_BUS_METHOD("Reboot", NULL, NULL, method_reboot, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_PARAM(old_unit) SD_BUS_METHOD("PowerOff", NULL, NULL, method_poweroff, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_PARAM(new_unit) SD_BUS_METHOD("Halt", NULL, NULL, method_halt, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_PARAM(mode), SD_BUS_METHOD("KExec", NULL, NULL, method_kexec, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
"o", SD_BUS_METHOD("SwitchRoot", "ss", NULL, method_switch_root, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_PARAM(job), SD_BUS_METHOD("SetEnvironment", "as", NULL, method_set_environment, SD_BUS_VTABLE_UNPRIVILEGED),
method_start_unit_replace, SD_BUS_METHOD("UnsetEnvironment", "as", NULL, method_unset_environment, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("UnsetAndSetEnvironment", "asas", NULL, method_unset_and_set_environment, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("StopUnit", SD_BUS_METHOD("ListUnitFiles", NULL, "a(ss)", method_list_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
"ss", SD_BUS_METHOD("ListUnitFilesByPatterns", "asas", "a(ss)", method_list_unit_files_by_patterns, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name) SD_BUS_METHOD("GetUnitFileState", "s", "s", method_get_unit_file_state, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("EnableUnitFiles", "asbb", "ba(sss)", method_enable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("DisableUnitFiles", "asb", "a(sss)", method_disable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(job), SD_BUS_METHOD("ReenableUnitFiles", "asbb", "ba(sss)", method_reenable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
method_stop_unit, SD_BUS_METHOD("LinkUnitFiles", "asbb", "a(sss)", method_link_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("PresetUnitFiles", "asbb", "ba(sss)", method_preset_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReloadUnit", SD_BUS_METHOD("PresetUnitFilesWithMode", "assbb", "ba(sss)", method_preset_unit_files_with_mode, SD_BUS_VTABLE_UNPRIVILEGED),
"ss", SD_BUS_METHOD("MaskUnitFiles", "asbb", "a(sss)", method_mask_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name) SD_BUS_METHOD("UnmaskUnitFiles", "asb", "a(sss)", method_unmask_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("RevertUnitFiles", "as", "a(sss)", method_revert_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("SetDefaultTarget", "sb", "a(sss)", method_set_default_target, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(job), SD_BUS_METHOD("GetDefaultTarget", NULL, "s", method_get_default_target, SD_BUS_VTABLE_UNPRIVILEGED),
method_reload_unit, SD_BUS_METHOD("PresetAllUnitFiles", "sbb", "a(sss)", method_preset_all_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("AddDependencyUnitFiles", "asssbb", "a(sss)", method_add_dependency_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RestartUnit", SD_BUS_METHOD("GetUnitFileLinks", "sb", "as", method_get_unit_file_links, SD_BUS_VTABLE_UNPRIVILEGED),
"ss", SD_BUS_METHOD("SetExitCode", "y", NULL, method_set_exit_code, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name) SD_BUS_METHOD("LookupDynamicUserByName", "s", "u", method_lookup_dynamic_user_by_name, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("LookupDynamicUserByUID", "u", "s", method_lookup_dynamic_user_by_uid, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("GetDynamicUsers", NULL, "a(us)", method_get_dynamic_users, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(job),
method_restart_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TryRestartUnit",
"ss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_try_restart_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReloadOrRestartUnit",
"ss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_reload_or_restart_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReloadOrTryRestartUnit",
"ss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_reload_or_try_restart_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("EnqueueUnitJob",
"sss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(job_type)
SD_BUS_PARAM(job_mode),
"uososa(uosos)",
SD_BUS_PARAM(job_id)
SD_BUS_PARAM(job_path)
SD_BUS_PARAM(unit_id)
SD_BUS_PARAM(unit_path)
SD_BUS_PARAM(job_type)
SD_BUS_PARAM(affected_jobs),
method_enqueue_unit_job,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("KillUnit",
"ssi",
SD_BUS_PARAM(name)
SD_BUS_PARAM(whom)
SD_BUS_PARAM(signal),
NULL,,
method_kill_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CleanUnit",
"sas",
SD_BUS_PARAM(name)
SD_BUS_PARAM(mask),
NULL,,
method_clean_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ResetFailedUnit",
"s",
SD_BUS_PARAM(name),
NULL,,
method_reset_failed_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetUnitProperties",
"sba(sv)",
SD_BUS_PARAM(name)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(properties),
NULL,,
method_set_unit_properties,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RefUnit",
"s",
SD_BUS_PARAM(name),
NULL,,
method_ref_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnrefUnit",
"s",
SD_BUS_PARAM(name),
NULL,,
method_unref_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("StartTransientUnit",
"ssa(sv)a(sa(sv))",
SD_BUS_PARAM(name)
SD_BUS_PARAM(mode)
SD_BUS_PARAM(properties)
SD_BUS_PARAM(aux),
"o",
SD_BUS_PARAM(job),
method_start_transient_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitProcesses",
"s",
SD_BUS_PARAM(name),
"a(sus)",
SD_BUS_PARAM(processes),
method_get_unit_processes,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("AttachProcessesToUnit",
"ssau",
SD_BUS_PARAM(unit_name)
SD_BUS_PARAM(subcgroup)
SD_BUS_PARAM(pids),
NULL,,
method_attach_processes_to_unit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("AbandonScope",
"s",
SD_BUS_PARAM(name),
NULL,,
method_abandon_scope,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetJob",
"u",
SD_BUS_PARAM(id),
"o",
SD_BUS_PARAM(job),
method_get_job,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetJobAfter",
"u",
SD_BUS_PARAM(id),
"a(usssoo)",
SD_BUS_PARAM(jobs),
method_get_job_waiting,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetJobBefore",
"u",
SD_BUS_PARAM(id),
"a(usssoo)",
SD_BUS_PARAM(jobs),
method_get_job_waiting,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CancelJob",
"u",
SD_BUS_PARAM(id),
NULL,,
method_cancel_job,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ClearJobs",
NULL,
NULL,
method_clear_jobs,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetFailed",
NULL,
NULL,
method_reset_failed,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnits",
NULL,,
"a(ssssssouso)",
SD_BUS_PARAM(units),
method_list_units,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnitsFiltered",
"as",
SD_BUS_PARAM(states),
"a(ssssssouso)",
SD_BUS_PARAM(units),
method_list_units_filtered,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnitsByPatterns",
"asas",
SD_BUS_PARAM(states)
SD_BUS_PARAM(patterns),
"a(ssssssouso)",
SD_BUS_PARAM(units),
method_list_units_by_patterns,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnitsByNames",
"as",
SD_BUS_PARAM(names),
"a(ssssssouso)",
SD_BUS_PARAM(units),
method_list_units_by_names,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListJobs",
NULL,,
"a(usssoo)",
SD_BUS_PARAM(jobs),
method_list_jobs,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Subscribe",
NULL,
NULL,
method_subscribe,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Unsubscribe",
NULL,
NULL,
method_unsubscribe,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Dump",
NULL,,
"s",
SD_BUS_PARAM(output),
method_dump,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("DumpByFileDescriptor",
NULL,,
"h",
SD_BUS_PARAM(fd),
method_dump_by_fd,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CreateSnapshot",
"sb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(cleanup),
"o",
SD_BUS_PARAM(unit),
method_refuse_snapshot,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_HIDDEN),
SD_BUS_METHOD_WITH_NAMES("RemoveSnapshot",
"s",
SD_BUS_PARAM(name),
NULL,,
method_refuse_snapshot,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_HIDDEN),
SD_BUS_METHOD("Reload",
NULL,
NULL,
method_reload,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Reexecute",
NULL,
NULL,
method_reexecute,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Exit",
NULL,
NULL,
method_exit,
0),
SD_BUS_METHOD("Reboot",
NULL,
NULL,
method_reboot,
SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD("PowerOff",
NULL,
NULL,
method_poweroff,
SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD("Halt",
NULL,
NULL,
method_halt,
SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD("KExec",
NULL,
NULL,
method_kexec,
SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD_WITH_NAMES("SwitchRoot",
"ss",
SD_BUS_PARAM(new_root)
SD_BUS_PARAM(init),
NULL,,
method_switch_root,
SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD_WITH_NAMES("SetEnvironment",
"as",
SD_BUS_PARAM(assignments),
NULL,,
method_set_environment,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnsetEnvironment",
"as",
SD_BUS_PARAM(names),
NULL,,
method_unset_environment,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnsetAndSetEnvironment",
"asas",
SD_BUS_PARAM(names)
SD_BUS_PARAM(assignments),
NULL,,
method_unset_and_set_environment,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnitFiles",
NULL,,
"a(ss)",
SD_BUS_PARAM(unit_files),
method_list_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUnitFilesByPatterns",
"asas",
SD_BUS_PARAM(states)
SD_BUS_PARAM(patterns),
"a(ss)",
SD_BUS_PARAM(unit_files),
method_list_unit_files_by_patterns,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitFileState",
"s",
SD_BUS_PARAM(file),
"s",
SD_BUS_PARAM(state),
method_get_unit_file_state,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("EnableUnitFiles",
"asbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"ba(sss)",
SD_BUS_PARAM(carries_install_info)
SD_BUS_PARAM(changes),
method_enable_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("DisableUnitFiles",
"asb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime),
"a(sss)",
SD_BUS_PARAM(changes),
method_disable_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReenableUnitFiles",
"asbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"ba(sss)",
SD_BUS_PARAM(carries_install_info)
SD_BUS_PARAM(changes),
method_reenable_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("LinkUnitFiles",
"asbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"a(sss)",
SD_BUS_PARAM(changes),
method_link_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PresetUnitFiles",
"asbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"ba(sss)",
SD_BUS_PARAM(carries_install_info)
SD_BUS_PARAM(changes),
method_preset_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PresetUnitFilesWithMode",
"assbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(mode)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"ba(sss)",
SD_BUS_PARAM(carries_install_info)
SD_BUS_PARAM(changes),
method_preset_unit_files_with_mode,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MaskUnitFiles",
"asbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"a(sss)",
SD_BUS_PARAM(changes),
method_mask_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnmaskUnitFiles",
"asb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(runtime),
"a(sss)",
SD_BUS_PARAM(changes),
method_unmask_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RevertUnitFiles",
"as",
SD_BUS_PARAM(files),
"a(sss)",
SD_BUS_PARAM(changes),
method_revert_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDefaultTarget",
"sb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(force),
"a(sss)",
SD_BUS_PARAM(changes),
method_set_default_target,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetDefaultTarget",
NULL,,
"s",
SD_BUS_PARAM(name),
method_get_default_target,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PresetAllUnitFiles",
"sbb",
SD_BUS_PARAM(mode)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"a(sss)",
SD_BUS_PARAM(changes),
method_preset_all_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("AddDependencyUnitFiles",
"asssbb",
SD_BUS_PARAM(files)
SD_BUS_PARAM(target)
SD_BUS_PARAM(type)
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(force),
"a(sss)",
SD_BUS_PARAM(changes),
method_add_dependency_unit_files,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUnitFileLinks",
"sb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(runtime),
"as",
SD_BUS_PARAM(links),
method_get_unit_file_links,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetExitCode",
"y",
SD_BUS_PARAM(number),
NULL,,
method_set_exit_code,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("LookupDynamicUserByName",
"s",
SD_BUS_PARAM(name),
"u",
SD_BUS_PARAM(uid),
method_lookup_dynamic_user_by_name,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("LookupDynamicUserByUID",
"u",
SD_BUS_PARAM(uid),
"s",
SD_BUS_PARAM(name),
method_lookup_dynamic_user_by_uid,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetDynamicUsers",
NULL,,
"a(us)",
SD_BUS_PARAM(users),
method_get_dynamic_users,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL_WITH_NAMES("UnitNew", SD_BUS_SIGNAL("UnitNew", "so", 0),
"so", SD_BUS_SIGNAL("UnitRemoved", "so", 0),
SD_BUS_PARAM(id) SD_BUS_SIGNAL("JobNew", "uos", 0),
SD_BUS_PARAM(unit), SD_BUS_SIGNAL("JobRemoved", "uoss", 0),
0), SD_BUS_SIGNAL("StartupFinished", "tttttt", 0),
SD_BUS_SIGNAL_WITH_NAMES("UnitRemoved",
"so",
SD_BUS_PARAM(id)
SD_BUS_PARAM(unit),
0),
SD_BUS_SIGNAL_WITH_NAMES("JobNew",
"uos",
SD_BUS_PARAM(id)
SD_BUS_PARAM(job)
SD_BUS_PARAM(unit),
0),
SD_BUS_SIGNAL_WITH_NAMES("JobRemoved",
"uoss",
SD_BUS_PARAM(id)
SD_BUS_PARAM(job)
SD_BUS_PARAM(unit)
SD_BUS_PARAM(result),
0),
SD_BUS_SIGNAL_WITH_NAMES("StartupFinished",
"tttttt",
SD_BUS_PARAM(firmware)
SD_BUS_PARAM(loader)
SD_BUS_PARAM(kernel)
SD_BUS_PARAM(initrd)
SD_BUS_PARAM(userspace)
SD_BUS_PARAM(total),
0),
SD_BUS_SIGNAL("UnitFilesChanged", NULL, 0), SD_BUS_SIGNAL("UnitFilesChanged", NULL, 0),
SD_BUS_SIGNAL_WITH_NAMES("Reloading", SD_BUS_SIGNAL("Reloading", "b", 0),
"b",
SD_BUS_PARAM(active),
0),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -843,103 +843,20 @@ const sd_bus_vtable bus_unit_vtable[] = {
SD_BUS_PROPERTY("CollectMode", "s", property_get_collect_mode, offsetof(Unit, collect_mode), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("CollectMode", "s", property_get_collect_mode, offsetof(Unit, collect_mode), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Refs", "as", property_get_refs, 0, 0), SD_BUS_PROPERTY("Refs", "as", property_get_refs, 0, 0),
SD_BUS_METHOD_WITH_NAMES("Start", SD_BUS_METHOD("Start", "s", "o", method_start, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("Stop", "s", "o", method_stop, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("Reload", "s", "o", method_reload, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("Restart", "s", "o", method_restart, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(job), SD_BUS_METHOD("TryRestart", "s", "o", method_try_restart, SD_BUS_VTABLE_UNPRIVILEGED),
method_start, SD_BUS_METHOD("ReloadOrRestart", "s", "o", method_reload_or_restart, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ReloadOrTryRestart", "s", "o", method_reload_or_try_restart, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Stop", SD_BUS_METHOD("EnqueueJob", "ss", "uososa(uosos)", bus_unit_method_enqueue_job, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("Kill", "si", NULL, bus_unit_method_kill, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(mode), SD_BUS_METHOD("ResetFailed", NULL, NULL, bus_unit_method_reset_failed, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("SetProperties", "ba(sv)", NULL, bus_unit_method_set_properties, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(job), SD_BUS_METHOD("Ref", NULL, NULL, bus_unit_method_ref, SD_BUS_VTABLE_UNPRIVILEGED),
method_stop, SD_BUS_METHOD("Unref", NULL, NULL, bus_unit_method_unref, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Clean", "as", NULL, bus_unit_method_clean, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Reload",
"s",
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_reload,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Restart",
"s",
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_restart,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TryRestart",
"s",
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_try_restart,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReloadOrRestart",
"s",
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_reload_or_restart,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReloadOrTryRestart",
"s",
SD_BUS_PARAM(mode),
"o",
SD_BUS_PARAM(job),
method_reload_or_try_restart,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("EnqueueJob",
"ss",
SD_BUS_PARAM(job_type)
SD_BUS_PARAM(job_mode),
"uososa(uosos)",
SD_BUS_PARAM(job_id)
SD_BUS_PARAM(job_path)
SD_BUS_PARAM(unit_id)
SD_BUS_PARAM(unit_path)
SD_BUS_PARAM(job_type)
SD_BUS_PARAM(affected_jobs),
bus_unit_method_enqueue_job,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Kill",
"si",
SD_BUS_PARAM(whom)
SD_BUS_PARAM(signal),
NULL,,
bus_unit_method_kill,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetFailed",
NULL,
NULL,
bus_unit_method_reset_failed,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetProperties",
"ba(sv)",
SD_BUS_PARAM(runtime)
SD_BUS_PARAM(properties),
NULL,,
bus_unit_method_set_properties,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Ref",
NULL,
NULL,
bus_unit_method_ref,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Unref",
NULL,
NULL,
bus_unit_method_unref,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Clean",
"as",
SD_BUS_PARAM(mask),
NULL,,
bus_unit_method_clean,
SD_BUS_VTABLE_UNPRIVILEGED),
/* For dependency types we don't support anymore always return an empty array */ /* For dependency types we don't support anymore always return an empty array */
SD_BUS_PROPERTY("RequiresOverridable", "as", property_get_empty_strv, 0, SD_BUS_VTABLE_HIDDEN), SD_BUS_PROPERTY("RequiresOverridable", "as", property_get_empty_strv, 0, SD_BUS_VTABLE_HIDDEN),
@ -949,7 +866,6 @@ const sd_bus_vtable bus_unit_vtable[] = {
/* Obsolete alias names */ /* Obsolete alias names */
SD_BUS_PROPERTY("StartLimitInterval", "t", bus_property_get_usec, offsetof(Unit, start_ratelimit.interval), SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), SD_BUS_PROPERTY("StartLimitInterval", "t", bus_property_get_usec, offsetof(Unit, start_ratelimit.interval), SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
SD_BUS_PROPERTY("StartLimitIntervalSec", "t", bus_property_get_usec, offsetof(Unit, start_ratelimit.interval), SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), SD_BUS_PROPERTY("StartLimitIntervalSec", "t", bus_property_get_usec, offsetof(Unit, start_ratelimit.interval), SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };
@ -1449,22 +1365,8 @@ const sd_bus_vtable bus_unit_cgroup_vtable[] = {
SD_BUS_PROPERTY("IOReadOperations", "t", property_get_io_counter, 0, 0), SD_BUS_PROPERTY("IOReadOperations", "t", property_get_io_counter, 0, 0),
SD_BUS_PROPERTY("IOWriteBytes", "t", property_get_io_counter, 0, 0), SD_BUS_PROPERTY("IOWriteBytes", "t", property_get_io_counter, 0, 0),
SD_BUS_PROPERTY("IOWriteOperations", "t", property_get_io_counter, 0, 0), SD_BUS_PROPERTY("IOWriteOperations", "t", property_get_io_counter, 0, 0),
SD_BUS_METHOD("GetProcesses", NULL, "a(sus)", bus_unit_method_get_processes, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetProcesses", SD_BUS_METHOD("AttachProcesses", "sau", NULL, bus_unit_method_attach_processes, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,,
"a(sus)",
SD_BUS_PARAM(processes),
bus_unit_method_get_processes,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("AttachProcesses",
"sau",
SD_BUS_PARAM(subcgroup)
SD_BUS_PARAM(pids),
NULL,,
bus_unit_method_attach_processes,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -677,64 +677,14 @@ static const sd_bus_vtable hostname_vtable[] = {
SD_BUS_PROPERTY("OperatingSystemPrettyName", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_OS_PRETTY_NAME, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("OperatingSystemPrettyName", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_OS_PRETTY_NAME, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("OperatingSystemCPEName", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_OS_CPE_NAME, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("OperatingSystemCPEName", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_OS_CPE_NAME, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("HomeURL", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_HOME_URL, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("HomeURL", "s", NULL, offsetof(Context, data) + sizeof(char*) * PROP_HOME_URL, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD("SetHostname", "sb", NULL, method_set_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetHostname", SD_BUS_METHOD("SetStaticHostname", "sb", NULL, method_set_static_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
"sb", SD_BUS_METHOD("SetPrettyHostname", "sb", NULL, method_set_pretty_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(hostname) SD_BUS_METHOD("SetIconName", "sb", NULL, method_set_icon_name, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(interactive), SD_BUS_METHOD("SetChassis", "sb", NULL, method_set_chassis, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("SetDeployment", "sb", NULL, method_set_deployment, SD_BUS_VTABLE_UNPRIVILEGED),
method_set_hostname, SD_BUS_METHOD("SetLocation", "sb", NULL, method_set_location, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetProductUUID", "b", "ay", method_get_product_uuid, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetStaticHostname",
"sb",
SD_BUS_PARAM(hostname)
SD_BUS_PARAM(interactive),
NULL,,
method_set_static_hostname,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetPrettyHostname",
"sb",
SD_BUS_PARAM(hostname)
SD_BUS_PARAM(interactive),
NULL,,
method_set_pretty_hostname,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetIconName",
"sb",
SD_BUS_PARAM(icon)
SD_BUS_PARAM(interactive),
NULL,,
method_set_icon_name,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetChassis",
"sb",
SD_BUS_PARAM(chassis)
SD_BUS_PARAM(interactive),
NULL,,
method_set_chassis,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDeployment",
"sb",
SD_BUS_PARAM(deployment)
SD_BUS_PARAM(interactive),
NULL,,
method_set_deployment,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLocation",
"sb",
SD_BUS_PARAM(location)
SD_BUS_PARAM(interactive),
NULL,,
method_set_location,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetProductUUID",
"b",
SD_BUS_PARAM(interactive),
"ay",
SD_BUS_PARAM(uuid),
method_get_product_uuid,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END, SD_BUS_VTABLE_END,
}; };

View File

@ -1112,128 +1112,30 @@ static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_verify, import_verify, ImportVe
static const sd_bus_vtable transfer_vtable[] = { static const sd_bus_vtable transfer_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("Id", "u", NULL, offsetof(Transfer, id), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Id", "u", NULL, offsetof(Transfer, id), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Local", "s", NULL, offsetof(Transfer, local), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Local", "s", NULL, offsetof(Transfer, local), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Remote", "s", NULL, offsetof(Transfer, remote), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Remote", "s", NULL, offsetof(Transfer, remote), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Type", "s", property_get_type, offsetof(Transfer, type), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Type", "s", property_get_type, offsetof(Transfer, type), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Verify", "s", property_get_verify, offsetof(Transfer, verify), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Verify", "s", property_get_verify, offsetof(Transfer, verify), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Progress", "d", property_get_progress, 0, 0), SD_BUS_PROPERTY("Progress", "d", property_get_progress, 0, 0),
SD_BUS_METHOD("Cancel", NULL, NULL, method_cancel, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Cancel", NULL, NULL, method_cancel, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL("LogMessage", "us", 0),
SD_BUS_SIGNAL_WITH_NAMES("LogMessage",
"us",
SD_BUS_PARAM(priority)
SD_BUS_PARAM(line),
0),
SD_BUS_VTABLE_END, SD_BUS_VTABLE_END,
}; };
static const sd_bus_vtable manager_vtable[] = { static const sd_bus_vtable manager_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_METHOD("ImportTar", "hsbb", "uo", method_import_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ImportTar", SD_BUS_METHOD("ImportRaw", "hsbb", "uo", method_import_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
"hsbb", SD_BUS_METHOD("ImportFileSystem", "hsbb", "uo", method_import_fs, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(fd) SD_BUS_METHOD("ExportTar", "shs", "uo", method_export_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(local_name) SD_BUS_METHOD("ExportRaw", "shs", "uo", method_export_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(force) SD_BUS_METHOD("PullTar", "sssb", "uo", method_pull_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(read_only), SD_BUS_METHOD("PullRaw", "sssb", "uo", method_pull_tar_or_raw, SD_BUS_VTABLE_UNPRIVILEGED),
"uo", SD_BUS_METHOD("ListTransfers", NULL, "a(usssdo)", method_list_transfers, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(transfer_id) SD_BUS_METHOD("CancelTransfer", "u", NULL, method_cancel_transfer, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(transfer_path), SD_BUS_SIGNAL("TransferNew", "uo", 0),
method_import_tar_or_raw, SD_BUS_SIGNAL("TransferRemoved", "uos", 0),
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ImportRaw",
"hsbb",
SD_BUS_PARAM(fd)
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(force)
SD_BUS_PARAM(read_only),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_import_tar_or_raw,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ImportFileSystem",
"hsbb",
SD_BUS_PARAM(fd)
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(force)
SD_BUS_PARAM(read_only),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_import_fs,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ExportTar",
"shs",
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(fd)
SD_BUS_PARAM(format),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_export_tar_or_raw,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ExportRaw",
"shs",
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(fd)
SD_BUS_PARAM(format),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_export_tar_or_raw,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PullTar",
"sssb",
SD_BUS_PARAM(url)
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(verify_mode)
SD_BUS_PARAM(force),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_pull_tar_or_raw,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PullRaw",
"sssb",
SD_BUS_PARAM(url)
SD_BUS_PARAM(local_name)
SD_BUS_PARAM(verify_mode)
SD_BUS_PARAM(force),
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
method_pull_tar_or_raw,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListTransfers",
NULL,,
"a(usssdo)",
SD_BUS_PARAM(transfers),
method_list_transfers,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CancelTransfer",
"u",
SD_BUS_PARAM(transfer_id),
NULL,,
method_cancel_transfer,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL_WITH_NAMES("TransferNew",
"uo",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("TransferRemoved",
"uos",
SD_BUS_PARAM(transfer_id)
SD_BUS_PARAM(transfer_path)
SD_BUS_PARAM(result),
0),
SD_BUS_VTABLE_END, SD_BUS_VTABLE_END,
}; };

View File

@ -676,35 +676,9 @@ static const sd_bus_vtable locale_vtable[] = {
SD_BUS_PROPERTY("X11Options", "s", property_get_xkb, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("X11Options", "s", property_get_xkb, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("VConsoleKeymap", "s", property_get_vconsole, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("VConsoleKeymap", "s", property_get_vconsole, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("VConsoleKeymapToggle", "s", property_get_vconsole, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("VConsoleKeymapToggle", "s", property_get_vconsole, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("SetLocale", "asb", NULL, method_set_locale, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLocale", SD_BUS_METHOD("SetVConsoleKeyboard", "ssbb", NULL, method_set_vc_keyboard, SD_BUS_VTABLE_UNPRIVILEGED),
"asb", SD_BUS_METHOD("SetX11Keyboard", "ssssbb", NULL, method_set_x11_keyboard, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(locale)
SD_BUS_PARAM(interactive),
NULL,,
method_set_locale,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetVConsoleKeyboard",
"ssbb",
SD_BUS_PARAM(keymap)
SD_BUS_PARAM(keymap_toggle)
SD_BUS_PARAM(convert)
SD_BUS_PARAM(interactive),
NULL,,
method_set_vc_keyboard,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetX11Keyboard",
"ssssbb",
SD_BUS_PARAM(layout)
SD_BUS_PARAM(model)
SD_BUS_PARAM(variant)
SD_BUS_PARAM(options)
SD_BUS_PARAM(convert)
SD_BUS_PARAM(interactive),
NULL,,
method_set_x11_keyboard,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -3367,389 +3367,66 @@ const sd_bus_vtable manager_vtable[] = {
SD_BUS_PROPERTY("NCurrentSessions", "t", property_get_hashmap_size, offsetof(Manager, sessions), 0), SD_BUS_PROPERTY("NCurrentSessions", "t", property_get_hashmap_size, offsetof(Manager, sessions), 0),
SD_BUS_PROPERTY("UserTasksMax", "t", property_get_compat_user_tasks_max, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), SD_BUS_PROPERTY("UserTasksMax", "t", property_get_compat_user_tasks_max, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
SD_BUS_METHOD_WITH_NAMES("GetSession", SD_BUS_METHOD("GetSession", "s", "o", method_get_session, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("GetSessionByPID", "u", "o", method_get_session_by_pid, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(session_id), SD_BUS_METHOD("GetUser", "u", "o", method_get_user, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("GetUserByPID", "u", "o", method_get_user_by_pid, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(object_path), SD_BUS_METHOD("GetSeat", "s", "o", method_get_seat, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_session, SD_BUS_METHOD("ListSessions", NULL, "a(susso)", method_list_sessions, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListUsers", NULL, "a(uso)", method_list_users, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetSessionByPID", SD_BUS_METHOD("ListSeats", NULL, "a(so)", method_list_seats, SD_BUS_VTABLE_UNPRIVILEGED),
"u", SD_BUS_METHOD("ListInhibitors", NULL, "a(ssssuu)", method_list_inhibitors, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(pid), SD_BUS_METHOD("CreateSession", "uusssssussbssa(sv)", "soshusub", method_create_session, 0),
"o", SD_BUS_METHOD("ReleaseSession", "s", NULL, method_release_session, 0),
SD_BUS_PARAM(object_path), SD_BUS_METHOD("ActivateSession", "s", NULL, method_activate_session, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_session_by_pid, SD_BUS_METHOD("ActivateSessionOnSeat", "ss", NULL, method_activate_session_on_seat, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("LockSession", "s", NULL, method_lock_session, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUser", SD_BUS_METHOD("UnlockSession", "s", NULL, method_lock_session, SD_BUS_VTABLE_UNPRIVILEGED),
"u", SD_BUS_METHOD("LockSessions", NULL, NULL, method_lock_sessions, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(uid), SD_BUS_METHOD("UnlockSessions", NULL, NULL, method_lock_sessions, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("KillSession", "ssi", NULL, method_kill_session, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(object_path), SD_BUS_METHOD("KillUser", "ui", NULL, method_kill_user, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_user, SD_BUS_METHOD("TerminateSession", "s", NULL, method_terminate_session, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("TerminateUser", "u", NULL, method_terminate_user, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUserByPID", SD_BUS_METHOD("TerminateSeat", "s", NULL, method_terminate_seat, SD_BUS_VTABLE_UNPRIVILEGED),
"u", SD_BUS_METHOD("SetUserLinger", "ubb", NULL, method_set_user_linger, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(pid), SD_BUS_METHOD("AttachDevice", "ssb", NULL, method_attach_device, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("FlushDevices", "b", NULL, method_flush_devices, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(object_path), SD_BUS_METHOD("PowerOff", "b", NULL, method_poweroff, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_user_by_pid, SD_BUS_METHOD("Reboot", "b", NULL, method_reboot, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Halt", "b", NULL, method_halt, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetSeat", SD_BUS_METHOD("Suspend", "b", NULL, method_suspend, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("Hibernate", "b", NULL, method_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(seat_id), SD_BUS_METHOD("HybridSleep", "b", NULL, method_hybrid_sleep, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("SuspendThenHibernate", "b", NULL, method_suspend_then_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(object_path), SD_BUS_METHOD("CanPowerOff", NULL, "s", method_can_poweroff, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_seat, SD_BUS_METHOD("CanReboot", NULL, "s", method_can_reboot, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("CanHalt", NULL, "s", method_can_halt, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListSessions", SD_BUS_METHOD("CanSuspend", NULL, "s", method_can_suspend, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("CanHibernate", NULL, "s", method_can_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
"a(susso)", SD_BUS_METHOD("CanHybridSleep", NULL, "s", method_can_hybrid_sleep, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(sessions), SD_BUS_METHOD("CanSuspendThenHibernate", NULL, "s", method_can_suspend_then_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
method_list_sessions, SD_BUS_METHOD("ScheduleShutdown", "st", NULL, method_schedule_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("CancelScheduledShutdown", NULL, "b", method_cancel_scheduled_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListUsers", SD_BUS_METHOD("Inhibit", "ssss", "h", method_inhibit, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("CanRebootParameter", NULL, "s", method_can_reboot_parameter, SD_BUS_VTABLE_UNPRIVILEGED),
"a(uso)", SD_BUS_METHOD("SetRebootParameter", "s", NULL, method_set_reboot_parameter, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(users), SD_BUS_METHOD("CanRebootToFirmwareSetup", NULL, "s", method_can_reboot_to_firmware_setup, SD_BUS_VTABLE_UNPRIVILEGED),
method_list_users, SD_BUS_METHOD("SetRebootToFirmwareSetup", "b", NULL, method_set_reboot_to_firmware_setup, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("CanRebootToBootLoaderMenu", NULL, "s", method_can_reboot_to_boot_loader_menu, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListSeats", SD_BUS_METHOD("SetRebootToBootLoaderMenu", "t", NULL, method_set_reboot_to_boot_loader_menu, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("CanRebootToBootLoaderEntry", NULL, "s", method_can_reboot_to_boot_loader_entry, SD_BUS_VTABLE_UNPRIVILEGED),
"a(so)", SD_BUS_METHOD("SetRebootToBootLoaderEntry", "s", NULL, method_set_reboot_to_boot_loader_entry, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(seats), SD_BUS_METHOD("SetWallMessage", "sb", NULL, method_set_wall_message, SD_BUS_VTABLE_UNPRIVILEGED),
method_list_seats,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListInhibitors",
NULL,,
"a(ssssuu)",
SD_BUS_PARAM(inhibitors),
method_list_inhibitors,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CreateSession",
"uusssssussbssa(sv)",
SD_BUS_PARAM(uid)
SD_BUS_PARAM(pid)
SD_BUS_PARAM(service)
SD_BUS_PARAM(type)
SD_BUS_PARAM(class)
SD_BUS_PARAM(desktop)
SD_BUS_PARAM(seat_id)
SD_BUS_PARAM(vtnr)
SD_BUS_PARAM(tty)
SD_BUS_PARAM(display)
SD_BUS_PARAM(remote)
SD_BUS_PARAM(remote_user)
SD_BUS_PARAM(remote_host)
SD_BUS_PARAM(properties),
"soshusub",
SD_BUS_PARAM(session_id)
SD_BUS_PARAM(object_path)
SD_BUS_PARAM(runtime_path)
SD_BUS_PARAM(fifo_fd)
SD_BUS_PARAM(uid)
SD_BUS_PARAM(seat_id)
SD_BUS_PARAM(vtnr)
SD_BUS_PARAM(existing),
method_create_session,
0),
SD_BUS_METHOD_WITH_NAMES("ReleaseSession",
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_release_session,
0),
SD_BUS_METHOD_WITH_NAMES("ActivateSession",
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_activate_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ActivateSessionOnSeat",
"ss",
SD_BUS_PARAM(session_id)
SD_BUS_PARAM(seat_id),
NULL,,
method_activate_session_on_seat,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("LockSession",
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_lock_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnlockSession",
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_lock_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("LockSessions",
NULL,
NULL,
method_lock_sessions,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("UnlockSessions",
NULL,
NULL,
method_lock_sessions,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("KillSession",
"ssi",
SD_BUS_PARAM(session_id)
SD_BUS_PARAM(who)
SD_BUS_PARAM(signal_number),
NULL,,
method_kill_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("KillUser",
"ui",
SD_BUS_PARAM(uid)
SD_BUS_PARAM(signal_number),
NULL,,
method_kill_user,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TerminateSession",
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_terminate_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TerminateUser",
"u",
SD_BUS_PARAM(uid),
NULL,,
method_terminate_user,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TerminateSeat",
"s",
SD_BUS_PARAM(seat_id),
NULL,,
method_terminate_seat,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetUserLinger",
"ubb",
SD_BUS_PARAM(uid)
SD_BUS_PARAM(enable)
SD_BUS_PARAM(interactive),
NULL,,
method_set_user_linger,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("AttachDevice",
"ssb",
SD_BUS_PARAM(seat_id)
SD_BUS_PARAM(sysfs_path)
SD_BUS_PARAM(interactive),
NULL,,
method_attach_device,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("FlushDevices",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_flush_devices,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PowerOff",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_poweroff,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Reboot",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_reboot,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Halt",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_halt,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Suspend",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_suspend,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Hibernate",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_hibernate,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("HybridSleep",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_hybrid_sleep,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SuspendThenHibernate",
"b",
SD_BUS_PARAM(interactive),
NULL,,
method_suspend_then_hibernate,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanPowerOff",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_poweroff,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanReboot",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_reboot,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanHalt",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_halt,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanSuspend",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_suspend,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanHibernate",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_hibernate,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanHybridSleep",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_hybrid_sleep,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanSuspendThenHibernate",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_suspend_then_hibernate,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ScheduleShutdown",
"st",
SD_BUS_PARAM(type)
SD_BUS_PARAM(usec),
NULL,,
method_schedule_shutdown,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CancelScheduledShutdown",
NULL,,
"b",
SD_BUS_PARAM(cancelled),
method_cancel_scheduled_shutdown,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Inhibit",
"ssss",
SD_BUS_PARAM(what)
SD_BUS_PARAM(who)
SD_BUS_PARAM(why)
SD_BUS_PARAM(mode),
"h",
SD_BUS_PARAM(pipe_fd),
method_inhibit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanRebootParameter",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_reboot_parameter,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetRebootParameter",
"s",
SD_BUS_PARAM(parameter),
NULL,,
method_set_reboot_parameter,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanRebootToFirmwareSetup",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_reboot_to_firmware_setup,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetRebootToFirmwareSetup",
"b",
SD_BUS_PARAM(enable),
NULL,,
method_set_reboot_to_firmware_setup,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanRebootToBootLoaderMenu",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_reboot_to_boot_loader_menu,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetRebootToBootLoaderMenu",
"t",
SD_BUS_PARAM(timeout),
NULL,,
method_set_reboot_to_boot_loader_menu,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CanRebootToBootLoaderEntry",
NULL,,
"s",
SD_BUS_PARAM(result),
method_can_reboot_to_boot_loader_entry,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetRebootToBootLoaderEntry",
"s",
SD_BUS_PARAM(boot_loader_entry),
NULL,,
method_set_reboot_to_boot_loader_entry,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetWallMessage",
"sb",
SD_BUS_PARAM(wall_message)
SD_BUS_PARAM(enable),
NULL,,
method_set_wall_message,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL_WITH_NAMES("SessionNew", SD_BUS_SIGNAL("SessionNew", "so", 0),
"so", SD_BUS_SIGNAL("SessionRemoved", "so", 0),
SD_BUS_PARAM(session_id) SD_BUS_SIGNAL("UserNew", "uo", 0),
SD_BUS_PARAM(object_path), SD_BUS_SIGNAL("UserRemoved", "uo", 0),
0), SD_BUS_SIGNAL("SeatNew", "so", 0),
SD_BUS_SIGNAL_WITH_NAMES("SessionRemoved", SD_BUS_SIGNAL("SeatRemoved", "so", 0),
"so", SD_BUS_SIGNAL("PrepareForShutdown", "b", 0),
SD_BUS_PARAM(session_id) SD_BUS_SIGNAL("PrepareForSleep", "b", 0),
SD_BUS_PARAM(object_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("UserNew",
"uo",
SD_BUS_PARAM(uid)
SD_BUS_PARAM(object_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("UserRemoved",
"uo",
SD_BUS_PARAM(uid)
SD_BUS_PARAM(object_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("SeatNew",
"so",
SD_BUS_PARAM(seat_id)
SD_BUS_PARAM(object_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("SeatRemoved",
"so",
SD_BUS_PARAM(seat_id)
SD_BUS_PARAM(object_path),
0),
SD_BUS_SIGNAL_WITH_NAMES("PrepareForShutdown",
"b",
SD_BUS_PARAM(start),
0),
SD_BUS_SIGNAL_WITH_NAMES("PrepareForSleep",
"b",
SD_BUS_PARAM(start),
0),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -305,20 +305,8 @@ const sd_bus_vtable seat_vtable[] = {
SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("Terminate", NULL, NULL, bus_seat_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Terminate", NULL, NULL, bus_seat_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ActivateSession", "s", NULL, method_activate_session, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ActivateSession", SD_BUS_METHOD("SwitchTo", "u", NULL, method_switch_to, SD_BUS_VTABLE_UNPRIVILEGED),
"s",
SD_BUS_PARAM(session_id),
NULL,,
method_activate_session,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SwitchTo",
"u",
SD_BUS_PARAM(vtnr),
NULL,,
method_switch_to,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SwitchToNext", NULL, NULL, method_switch_to_next, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("SwitchToNext", NULL, NULL, method_switch_to_next, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SwitchToPrevious", NULL, NULL, method_switch_to_previous, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("SwitchToPrevious", NULL, NULL, method_switch_to_previous, SD_BUS_VTABLE_UNPRIVILEGED),

View File

@ -583,100 +583,22 @@ const sd_bus_vtable session_vtable[] = {
SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("LockedHint", "b", property_get_locked_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("LockedHint", "b", property_get_locked_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_METHOD("Terminate", SD_BUS_METHOD("Terminate", NULL, NULL, bus_session_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("Activate", NULL, NULL, bus_session_method_activate, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("Lock", NULL, NULL, bus_session_method_lock, SD_BUS_VTABLE_UNPRIVILEGED),
bus_session_method_terminate, SD_BUS_METHOD("Unlock", NULL, NULL, bus_session_method_lock, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("SetIdleHint", "b", NULL, method_set_idle_hint, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Activate", SD_BUS_METHOD("SetLockedHint", "b", NULL, method_set_locked_hint, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("Kill", "si", NULL, bus_session_method_kill, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("TakeControl", "b", NULL, method_take_control, SD_BUS_VTABLE_UNPRIVILEGED),
bus_session_method_activate, SD_BUS_METHOD("ReleaseControl", NULL, NULL, method_release_control, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("TakeDevice", "uu", "hb", method_take_device, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Lock", SD_BUS_METHOD("ReleaseDevice", "uu", NULL, method_release_device, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("PauseDeviceComplete", "uu", NULL, method_pause_device_complete, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("SetBrightness", "ssu", NULL, method_set_brightness, SD_BUS_VTABLE_UNPRIVILEGED),
bus_session_method_lock,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Unlock",
NULL,
NULL,
bus_session_method_lock,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetIdleHint",
"b",
SD_BUS_PARAM(idle),
NULL,,
method_set_idle_hint,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLockedHint",
"b",
SD_BUS_PARAM(locked),
NULL,,
method_set_locked_hint,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Kill",
"si",
SD_BUS_PARAM(who)
SD_BUS_PARAM(signal_number),
NULL,,
bus_session_method_kill,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TakeControl",
"b",
SD_BUS_PARAM(force),
NULL,,
method_take_control,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ReleaseControl",
NULL,
NULL,
method_release_control,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TakeDevice",
"uu",
SD_BUS_PARAM(major)
SD_BUS_PARAM(minor),
"hb",
SD_BUS_PARAM(fd)
SD_BUS_PARAM(inactive),
method_take_device,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ReleaseDevice",
"uu",
SD_BUS_PARAM(major)
SD_BUS_PARAM(minor),
NULL,,
method_release_device,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("PauseDeviceComplete",
"uu",
SD_BUS_PARAM(major)
SD_BUS_PARAM(minor),
NULL,,
method_pause_device_complete,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetBrightness",
"ssu",
SD_BUS_PARAM(subsystem)
SD_BUS_PARAM(name)
SD_BUS_PARAM(brightness),
NULL,,
method_set_brightness,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL_WITH_NAMES("PauseDevice", SD_BUS_SIGNAL("PauseDevice", "uus", 0),
"uus", SD_BUS_SIGNAL("ResumeDevice", "uuh", 0),
SD_BUS_PARAM(major)
SD_BUS_PARAM(minor)
SD_BUS_PARAM(type),
0),
SD_BUS_SIGNAL_WITH_NAMES("ResumeDevice",
"uuh",
SD_BUS_PARAM(major)
SD_BUS_PARAM(minor)
SD_BUS_PARAM(fd),
0),
SD_BUS_SIGNAL("Lock", NULL, 0), SD_BUS_SIGNAL("Lock", NULL, 0),
SD_BUS_SIGNAL("Unlock", NULL, 0), SD_BUS_SIGNAL("Unlock", NULL, 0),

View File

@ -277,12 +277,7 @@ const sd_bus_vtable user_vtable[] = {
SD_BUS_PROPERTY("Linger", "b", property_get_linger, 0, 0), SD_BUS_PROPERTY("Linger", "b", property_get_linger, 0, 0),
SD_BUS_METHOD("Terminate", NULL, NULL, bus_user_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Terminate", NULL, NULL, bus_user_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Kill", SD_BUS_METHOD("Kill", "i", NULL, bus_user_method_kill, SD_BUS_VTABLE_UNPRIVILEGED),
"i",
SD_BUS_PARAM(signal_number),
NULL,,
bus_user_method_kill,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -1334,92 +1334,18 @@ const sd_bus_vtable machine_vtable[] = {
SD_BUS_PROPERTY("RootDirectory", "s", NULL, offsetof(Machine, root_directory), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("RootDirectory", "s", NULL, offsetof(Machine, root_directory), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("NetworkInterfaces", "ai", property_get_netif, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("NetworkInterfaces", "ai", property_get_netif, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("State", "s", property_get_state, 0, 0), SD_BUS_PROPERTY("State", "s", property_get_state, 0, 0),
SD_BUS_METHOD("Terminate", NULL, NULL, bus_machine_method_terminate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Terminate", SD_BUS_METHOD("Kill", "si", NULL, bus_machine_method_kill, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("GetAddresses", NULL, "a(iay)", bus_machine_method_get_addresses, SD_BUS_VTABLE_UNPRIVILEGED),
NULL, SD_BUS_METHOD("GetOSRelease", NULL, "a{ss}", bus_machine_method_get_os_release, SD_BUS_VTABLE_UNPRIVILEGED),
bus_machine_method_terminate, SD_BUS_METHOD("GetUIDShift", NULL, "u", bus_machine_method_get_uid_shift, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("OpenPTY", NULL, "hs", bus_machine_method_open_pty, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Kill", SD_BUS_METHOD("OpenLogin", NULL, "hs", bus_machine_method_open_login, SD_BUS_VTABLE_UNPRIVILEGED),
"si", SD_BUS_METHOD("OpenShell", "ssasas", "hs", bus_machine_method_open_shell, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(who) SD_BUS_METHOD("BindMount", "ssbb", NULL, bus_machine_method_bind_mount, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(signal), SD_BUS_METHOD("CopyFrom", "ss", NULL, bus_machine_method_copy, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("CopyTo", "ss", NULL, bus_machine_method_copy, SD_BUS_VTABLE_UNPRIVILEGED),
bus_machine_method_kill, SD_BUS_METHOD("OpenRootDirectory", NULL, "h", bus_machine_method_open_root_directory, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetAddresses",
NULL,,
"a(iay)",
SD_BUS_PARAM(addresses),
bus_machine_method_get_addresses,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetOSRelease",
NULL,,
"a{ss}",
SD_BUS_PARAM(fields),
bus_machine_method_get_os_release,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetUIDShift",
NULL,,
"u",
SD_BUS_PARAM(shift),
bus_machine_method_get_uid_shift,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenPTY",
NULL,,
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
bus_machine_method_open_pty,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenLogin",
NULL,,
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
bus_machine_method_open_login,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenShell",
"ssasas",
SD_BUS_PARAM(user)
SD_BUS_PARAM(path)
SD_BUS_PARAM(args)
SD_BUS_PARAM(environment),
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
bus_machine_method_open_shell,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("BindMount",
"ssbb",
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination)
SD_BUS_PARAM(read_only)
SD_BUS_PARAM(mkdir),
NULL,,
bus_machine_method_bind_mount,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CopyFrom",
"ss",
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination),
NULL,,
bus_machine_method_copy,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CopyTo",
"ss",
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination),
NULL,,
bus_machine_method_copy,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenRootDirectory",
NULL,,
"h",
SD_BUS_PARAM(fd),
bus_machine_method_open_root_directory,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -1127,316 +1127,48 @@ static int method_map_to_machine_group(sd_bus_message *message, void *groupdata,
const sd_bus_vtable manager_vtable[] = { const sd_bus_vtable manager_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("PoolPath", "s", property_get_pool_path, 0, 0), SD_BUS_PROPERTY("PoolPath", "s", property_get_pool_path, 0, 0),
SD_BUS_PROPERTY("PoolUsage", "t", property_get_pool_usage, 0, 0), SD_BUS_PROPERTY("PoolUsage", "t", property_get_pool_usage, 0, 0),
SD_BUS_PROPERTY("PoolLimit", "t", property_get_pool_limit, 0, 0), SD_BUS_PROPERTY("PoolLimit", "t", property_get_pool_limit, 0, 0),
SD_BUS_METHOD("GetMachine", "s", "o", method_get_machine, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetMachine", SD_BUS_METHOD("GetImage", "s", "o", method_get_image, SD_BUS_VTABLE_UNPRIVILEGED),
"s", SD_BUS_METHOD("GetMachineByPID", "u", "o", method_get_machine_by_pid, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name), SD_BUS_METHOD("ListMachines", NULL, "a(ssso)", method_list_machines, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("ListImages", NULL, "a(ssbttto)", method_list_images, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(machine), SD_BUS_METHOD("CreateMachine", "sayssusa(sv)", "o", method_create_machine, 0),
method_get_machine, SD_BUS_METHOD("CreateMachineWithNetwork", "sayssusaia(sv)", "o", method_create_machine_with_network, 0),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("RegisterMachine", "sayssus", "o", method_register_machine, 0),
SD_BUS_METHOD_WITH_NAMES("GetImage", SD_BUS_METHOD("RegisterMachineWithNetwork", "sayssusai", "o", method_register_machine_with_network, 0),
"s", SD_BUS_METHOD("UnregisterMachine", "s", NULL, method_unregister_machine, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name), SD_BUS_METHOD("TerminateMachine", "s", NULL, method_terminate_machine, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("KillMachine", "ssi", NULL, method_kill_machine, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(image), SD_BUS_METHOD("GetMachineAddresses", "s", "a(iay)", method_get_machine_addresses, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_image, SD_BUS_METHOD("GetMachineOSRelease", "s", "a{ss}", method_get_machine_os_release, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("OpenMachinePTY", "s", "hs", method_open_machine_pty, 0),
SD_BUS_METHOD_WITH_NAMES("GetMachineByPID", SD_BUS_METHOD("OpenMachineLogin", "s", "hs", method_open_machine_login, SD_BUS_VTABLE_UNPRIVILEGED),
"u", SD_BUS_METHOD("OpenMachineShell", "sssasas", "hs", method_open_machine_shell, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(pid), SD_BUS_METHOD("BindMountMachine", "sssbb", NULL, method_bind_mount_machine, SD_BUS_VTABLE_UNPRIVILEGED),
"o", SD_BUS_METHOD("CopyFromMachine", "sss", NULL, method_copy_machine, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(machine), SD_BUS_METHOD("CopyToMachine", "sss", NULL, method_copy_machine, SD_BUS_VTABLE_UNPRIVILEGED),
method_get_machine_by_pid, SD_BUS_METHOD("OpenMachineRootDirectory", "s", "h", method_open_machine_root_directory, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetMachineUIDShift", "s", "u", method_get_machine_uid_shift, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListMachines", SD_BUS_METHOD("RemoveImage", "s", NULL, method_remove_image, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("RenameImage", "ss", NULL, method_rename_image, SD_BUS_VTABLE_UNPRIVILEGED),
"a(ssso)", SD_BUS_METHOD("CloneImage", "ssb", NULL, method_clone_image, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(machines), SD_BUS_METHOD("MarkImageReadOnly", "sb", NULL, method_mark_image_read_only, SD_BUS_VTABLE_UNPRIVILEGED),
method_list_machines, SD_BUS_METHOD("GetImageHostname", "s", "s", method_get_image_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetImageMachineID", "s", "ay", method_get_image_machine_id, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListImages", SD_BUS_METHOD("GetImageMachineInfo", "s", "a{ss}", method_get_image_machine_info, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("GetImageOSRelease", "s", "a{ss}", method_get_image_os_release, SD_BUS_VTABLE_UNPRIVILEGED),
"a(ssbttto)", SD_BUS_METHOD("SetPoolLimit", "t", NULL, method_set_pool_limit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(images), SD_BUS_METHOD("SetImageLimit", "st", NULL, method_set_image_limit, SD_BUS_VTABLE_UNPRIVILEGED),
method_list_images, SD_BUS_METHOD("CleanPool", "s", "a(st)", method_clean_pool, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("MapFromMachineUser", "su", "u", method_map_from_machine_user, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CreateMachine", SD_BUS_METHOD("MapToMachineUser", "u", "sou", method_map_to_machine_user, SD_BUS_VTABLE_UNPRIVILEGED),
"sayssusa(sv)", SD_BUS_METHOD("MapFromMachineGroup", "su", "u", method_map_from_machine_group, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(name) SD_BUS_METHOD("MapToMachineGroup", "u", "sou", method_map_to_machine_group, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(id) SD_BUS_SIGNAL("MachineNew", "so", 0),
SD_BUS_PARAM(service) SD_BUS_SIGNAL("MachineRemoved", "so", 0),
SD_BUS_PARAM(class)
SD_BUS_PARAM(leader)
SD_BUS_PARAM(root_directory)
SD_BUS_PARAM(scope_properties),
"o",
SD_BUS_PARAM(path),
method_create_machine, 0),
SD_BUS_METHOD_WITH_NAMES("CreateMachineWithNetwork",
"sayssusaia(sv)",
SD_BUS_PARAM(name)
SD_BUS_PARAM(id)
SD_BUS_PARAM(service)
SD_BUS_PARAM(class)
SD_BUS_PARAM(leader)
SD_BUS_PARAM(root_directory)
SD_BUS_PARAM(ifindices)
SD_BUS_PARAM(scope_properties),
"o",
SD_BUS_PARAM(path),
method_create_machine_with_network, 0),
SD_BUS_METHOD_WITH_NAMES("RegisterMachine",
"sayssus",
SD_BUS_PARAM(name)
SD_BUS_PARAM(id)
SD_BUS_PARAM(service)
SD_BUS_PARAM(class)
SD_BUS_PARAM(leader)
SD_BUS_PARAM(root_directory),
"o",
SD_BUS_PARAM(path),
method_register_machine, 0),
SD_BUS_METHOD_WITH_NAMES("RegisterMachineWithNetwork",
"sayssusai",
SD_BUS_PARAM(name)
SD_BUS_PARAM(id)
SD_BUS_PARAM(service)
SD_BUS_PARAM(class)
SD_BUS_PARAM(leader)
SD_BUS_PARAM(root_directory)
SD_BUS_PARAM(ifindices),
"o",
SD_BUS_PARAM(path),
method_register_machine_with_network, 0),
SD_BUS_METHOD_WITH_NAMES("UnregisterMachine",
"s",
SD_BUS_PARAM(name),
NULL,,
method_unregister_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("TerminateMachine",
"s",
SD_BUS_PARAM(id),
NULL,,
method_terminate_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("KillMachine",
"ssi",
SD_BUS_PARAM(name)
SD_BUS_PARAM(who)
SD_BUS_PARAM(signal),
NULL,,
method_kill_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetMachineAddresses",
"s",
SD_BUS_PARAM(name),
"a(iay)",
SD_BUS_PARAM(addresses),
method_get_machine_addresses,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetMachineOSRelease",
"s",
SD_BUS_PARAM(name),
"a{ss}",
SD_BUS_PARAM(fields),
method_get_machine_os_release,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenMachinePTY",
"s",
SD_BUS_PARAM(name),
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
method_open_machine_pty,
0),
SD_BUS_METHOD_WITH_NAMES("OpenMachineLogin",
"s",
SD_BUS_PARAM(name),
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
method_open_machine_login,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenMachineShell",
"sssasas",
SD_BUS_PARAM(name)
SD_BUS_PARAM(user)
SD_BUS_PARAM(path)
SD_BUS_PARAM(args)
SD_BUS_PARAM(environment),
"hs",
SD_BUS_PARAM(pty)
SD_BUS_PARAM(pty_path),
method_open_machine_shell,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("BindMountMachine",
"sssbb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination)
SD_BUS_PARAM(read_only)
SD_BUS_PARAM(mkdir),
NULL,,
method_bind_mount_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CopyFromMachine",
"sss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination),
NULL,,
method_copy_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CopyToMachine",
"sss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(source)
SD_BUS_PARAM(destination),
NULL,,
method_copy_machine,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("OpenMachineRootDirectory",
"s",
SD_BUS_PARAM(name),
"h",
SD_BUS_PARAM(fd),
method_open_machine_root_directory,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetMachineUIDShift",
"s",
SD_BUS_PARAM(name),
"u",
SD_BUS_PARAM(shift),
method_get_machine_uid_shift,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RemoveImage",
"s",
SD_BUS_PARAM(name),
NULL,,
method_remove_image,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RenameImage",
"ss",
SD_BUS_PARAM(name)
SD_BUS_PARAM(new_name),
NULL,,
method_rename_image,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CloneImage",
"ssb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(new_name)
SD_BUS_PARAM(read_only),
NULL,,
method_clone_image,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MarkImageReadOnly",
"sb",
SD_BUS_PARAM(name)
SD_BUS_PARAM(read_only),
NULL,,
method_mark_image_read_only,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetImageHostname",
"s",
SD_BUS_PARAM(name),
"s",
SD_BUS_PARAM(hostname),
method_get_image_hostname,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetImageMachineID",
"s",
SD_BUS_PARAM(name),
"ay",
SD_BUS_PARAM(id),
method_get_image_machine_id,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetImageMachineInfo",
"s",
SD_BUS_PARAM(name),
"a{ss}",
SD_BUS_PARAM(machine_info),
method_get_image_machine_info,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetImageOSRelease",
"s",
SD_BUS_PARAM(name),
"a{ss}",
SD_BUS_PARAM(os_release),
method_get_image_os_release,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetPoolLimit",
"t",
SD_BUS_PARAM(size),
NULL,,
method_set_pool_limit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetImageLimit",
"st",
SD_BUS_PARAM(name)
SD_BUS_PARAM(size),
NULL,,
method_set_image_limit,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("CleanPool",
"s",
SD_BUS_PARAM(mode),
"a(st)",
SD_BUS_PARAM(images),
method_clean_pool,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MapFromMachineUser",
"su",
SD_BUS_PARAM(name)
SD_BUS_PARAM(uid_inner),
"u",
SD_BUS_PARAM(uid_outer),
method_map_from_machine_user,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MapToMachineUser",
"u",
SD_BUS_PARAM(uid_outer),
"sou",
SD_BUS_PARAM(machine_name)
SD_BUS_PARAM(machine_path)
SD_BUS_PARAM(uid_inner),
method_map_to_machine_user,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MapFromMachineGroup",
"su",
SD_BUS_PARAM(name)
SD_BUS_PARAM(gid_inner),
"u",
SD_BUS_PARAM(gid_outer),
method_map_from_machine_group,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("MapToMachineGroup",
"u",
SD_BUS_PARAM(gid_outer),
"sou",
SD_BUS_PARAM(machine_name)
SD_BUS_PARAM(machine_path)
SD_BUS_PARAM(gid_inner),
method_map_to_machine_group,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_SIGNAL_WITH_NAMES("MachineNew",
"so",
SD_BUS_PARAM(machine)
SD_BUS_PARAM(path),
0),
SD_BUS_SIGNAL_WITH_NAMES("MachineRemoved",
"so",
SD_BUS_PARAM(machine)
SD_BUS_PARAM(path),
0),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END
}; };

View File

@ -1853,165 +1853,26 @@ static const sd_bus_vtable resolve_vtable[] = {
SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", bus_property_get_ntas, 0, 0), SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", bus_property_get_ntas, 0, 0),
SD_BUS_PROPERTY("DNSStubListener", "s", bus_property_get_dns_stub_listener_mode, offsetof(Manager, dns_stub_listener_mode), 0), SD_BUS_PROPERTY("DNSStubListener", "s", bus_property_get_dns_stub_listener_mode, offsetof(Manager, dns_stub_listener_mode), 0),
SD_BUS_METHOD("ResolveHostname", "isit", "a(iiay)st", bus_method_resolve_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveAddress", "iiayt", "a(is)t", bus_method_resolve_address, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveRecord", "isqqt", "a(iqqay)t", bus_method_resolve_record, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveService", "isssit", "a(qqqsa(iiay)s)aayssst", bus_method_resolve_service, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetStatistics", NULL, NULL, bus_method_reset_statistics, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("FlushCaches", NULL, NULL, bus_method_flush_caches, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetServerFeatures", NULL, NULL, bus_method_reset_server_features, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("GetLink", "i", "o", bus_method_get_link, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDNS", "ia(iay)", NULL, bus_method_set_link_dns_servers, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDomains", "ia(sb)", NULL, bus_method_set_link_domains, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDefaultRoute", "ib", NULL, bus_method_set_link_default_route, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkLLMNR", "is", NULL, bus_method_set_link_llmnr, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkMulticastDNS", "is", NULL, bus_method_set_link_mdns, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDNSOverTLS", "is", NULL, bus_method_set_link_dns_over_tls, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDNSSEC", "is", NULL, bus_method_set_link_dnssec, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDNSSECNegativeTrustAnchors", "ias", NULL, bus_method_set_link_dnssec_negative_trust_anchors, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("RevertLink", "i", NULL, bus_method_revert_link, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("RegisterService", "sssqqqaa{say}", "o", bus_method_register_service, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ResolveHostname", SD_BUS_METHOD("UnregisterService", "o", NULL, bus_method_unregister_service, SD_BUS_VTABLE_UNPRIVILEGED),
"isit",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(name)
SD_BUS_PARAM(family)
SD_BUS_PARAM(flags),
"a(iiay)st",
SD_BUS_PARAM(addresses)
SD_BUS_PARAM(canonical)
SD_BUS_PARAM(flags),
bus_method_resolve_hostname,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ResolveAddress",
"iiayt",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(family)
SD_BUS_PARAM(address)
SD_BUS_PARAM(flags),
"a(is)t",
SD_BUS_PARAM(names)
SD_BUS_PARAM(flags),
bus_method_resolve_address,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ResolveRecord",
"isqqt",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(name)
SD_BUS_PARAM(class)
SD_BUS_PARAM(type)
SD_BUS_PARAM(flags),
"a(iqqay)t",
SD_BUS_PARAM(records)
SD_BUS_PARAM(flags),
bus_method_resolve_record,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ResolveService",
"isssit",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(name)
SD_BUS_PARAM(type)
SD_BUS_PARAM(domain)
SD_BUS_PARAM(family)
SD_BUS_PARAM(flags),
"a(qqqsa(iiay)s)aayssst",
SD_BUS_PARAM(srv_data)
SD_BUS_PARAM(txt_data)
SD_BUS_PARAM(canonical_name)
SD_BUS_PARAM(canonical_type)
SD_BUS_PARAM(canonical_domain)
SD_BUS_PARAM(flags),
bus_method_resolve_service,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("GetLink",
"i",
SD_BUS_PARAM(ifindex),
"o",
SD_BUS_PARAM(path),
bus_method_get_link,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDNS",
"ia(iay)",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(addresses),
NULL,,
bus_method_set_link_dns_servers,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDomains",
"ia(sb)",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(domains),
NULL,,
bus_method_set_link_domains,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDefaultRoute",
"ib",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(enable),
NULL,,
bus_method_set_link_default_route,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkLLMNR",
"is",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(mode),
NULL,,
bus_method_set_link_llmnr,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkMulticastDNS",
"is",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(mode),
NULL,,
bus_method_set_link_mdns,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDNSOverTLS",
"is",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(mode),
NULL,,
bus_method_set_link_dns_over_tls,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDNSSEC",
"is",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(mode),
NULL,,
bus_method_set_link_dnssec,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLinkDNSSECNegativeTrustAnchors",
"ias",
SD_BUS_PARAM(ifindex)
SD_BUS_PARAM(names),
NULL,,
bus_method_set_link_dnssec_negative_trust_anchors,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RevertLink",
"i",
SD_BUS_PARAM(ifindex),
NULL,,
bus_method_revert_link,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("RegisterService",
"sssqqqaa{say}",
SD_BUS_PARAM(name)
SD_BUS_PARAM(name_template)
SD_BUS_PARAM(type)
SD_BUS_PARAM(service_port)
SD_BUS_PARAM(service_priority)
SD_BUS_PARAM(serwise_weight)
SD_BUS_PARAM(txt_datas),
"o",
SD_BUS_PARAM(service_path),
bus_method_register_service,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("UnregisterService",
"o",
SD_BUS_PARAM(service_path),
NULL,,
bus_method_unregister_service,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetStatistics",
NULL,
NULL,
bus_method_reset_statistics,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("FlushCaches",
NULL,
NULL,
bus_method_flush_caches,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResetServerFeatures",
NULL,
NULL,
bus_method_reset_server_features,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END, SD_BUS_VTABLE_END,
}; };

View File

@ -697,55 +697,14 @@ const sd_bus_vtable link_vtable[] = {
SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", property_get_ntas, 0, 0), SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", property_get_ntas, 0, 0),
SD_BUS_PROPERTY("DNSSECSupported", "b", property_get_dnssec_supported, 0, 0), SD_BUS_PROPERTY("DNSSECSupported", "b", property_get_dnssec_supported, 0, 0),
SD_BUS_METHOD_WITH_NAMES("SetDNS", SD_BUS_METHOD("SetDNS", "a(iay)", NULL, bus_link_method_set_dns_servers, SD_BUS_VTABLE_UNPRIVILEGED),
"a(iay)", SD_BUS_METHOD("SetDomains", "a(sb)", NULL, bus_link_method_set_domains, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(addresses), SD_BUS_METHOD("SetDefaultRoute", "b", NULL, bus_link_method_set_default_route, SD_BUS_VTABLE_UNPRIVILEGED),
NULL,, SD_BUS_METHOD("SetLLMNR", "s", NULL, bus_link_method_set_llmnr, SD_BUS_VTABLE_UNPRIVILEGED),
bus_link_method_set_dns_servers, SD_BUS_METHOD("SetMulticastDNS", "s", NULL, bus_link_method_set_mdns, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("SetDNSOverTLS", "s", NULL, bus_link_method_set_dns_over_tls, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDomains", SD_BUS_METHOD("SetDNSSEC", "s", NULL, bus_link_method_set_dnssec, SD_BUS_VTABLE_UNPRIVILEGED),
"a(sb)", SD_BUS_METHOD("SetDNSSECNegativeTrustAnchors", "as", NULL, bus_link_method_set_dnssec_negative_trust_anchors, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(domains),
NULL,,
bus_link_method_set_domains,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDefaultRoute",
"b",
SD_BUS_PARAM(enable),
NULL,,
bus_link_method_set_default_route,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLLMNR",
"s",
SD_BUS_PARAM(mode),
NULL,,
bus_link_method_set_llmnr,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetMulticastDNS",
"s",
SD_BUS_PARAM(mode),
NULL,,
bus_link_method_set_mdns,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDNSOverTLS",
"s",
SD_BUS_PARAM(mode),
NULL,,
bus_link_method_set_dns_over_tls,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDNSSEC",
"s",
SD_BUS_PARAM(mode),
NULL,,
bus_link_method_set_dnssec,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetDNSSECNegativeTrustAnchors",
"as",
SD_BUS_PARAM(names),
NULL,,
bus_link_method_set_dnssec_negative_trust_anchors,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Revert", NULL, NULL, bus_link_method_revert, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Revert", NULL, NULL, bus_link_method_revert, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END SD_BUS_VTABLE_END

View File

@ -55,12 +55,12 @@ int read_reboot_parameter(char **parameter) {
int reboot_with_parameter(RebootFlags flags) { int reboot_with_parameter(RebootFlags flags) {
int r; int r;
/* Reboots the system with a parameter that is read from /run/systemd/reboot-param. Returns 0 if /* Reboots the system with a parameter that is read from /run/systemd/reboot-param. Returns 0 if REBOOT_DRY_RUN
* REBOOT_DRY_RUN was set and the actual reboot operation was hence skipped. If REBOOT_FALLBACK is * was set and the actual reboot operation was hence skipped. If REBOOT_FALLBACK is set and the reboot with
* set and the reboot with parameter doesn't work out a fallback to classic reboot() is attempted. If * parameter doesn't work out a fallback to classic reboot() is attempted. If REBOOT_FALLBACK is not set, 0 is
* REBOOT_FALLBACK is not set, 0 is returned instead, which should be considered indication for the * returned instead, which should be considered indication for the caller to fall back to reboot() on its own,
* caller to fall back to reboot() on its own, or somehow else deal with this. If REBOOT_LOG is * or somehow else deal with this. If REBOOT_LOG is specified will log about what it is going to do, as well as
* specified will log about what it is going to do, as well as all errors. */ * all errors. */
if (detect_container() == 0) { if (detect_container() == 0) {
_cleanup_free_ char *parameter = NULL; _cleanup_free_ char *parameter = NULL;
@ -71,6 +71,7 @@ int reboot_with_parameter(RebootFlags flags) {
"Failed to read reboot parameter file, ignoring: %m"); "Failed to read reboot parameter file, ignoring: %m");
if (!isempty(parameter)) { if (!isempty(parameter)) {
log_full(flags & REBOOT_LOG ? LOG_INFO : LOG_DEBUG, log_full(flags & REBOOT_LOG ? LOG_INFO : LOG_DEBUG,
"Rebooting with argument '%s'.", parameter); "Rebooting with argument '%s'.", parameter);

View File

@ -1035,7 +1035,6 @@ static int method_list_timezones(sd_bus_message *m, void *userdata, sd_bus_error
static const sd_bus_vtable timedate_vtable[] = { static const sd_bus_vtable timedate_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("Timezone", "s", NULL, offsetof(Context, zone), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("Timezone", "s", NULL, offsetof(Context, zone), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("LocalRTC", "b", bus_property_get_bool, offsetof(Context, local_rtc), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("LocalRTC", "b", bus_property_get_bool, offsetof(Context, local_rtc), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("CanNTP", "b", property_get_can_ntp, 0, 0), SD_BUS_PROPERTY("CanNTP", "b", property_get_can_ntp, 0, 0),
@ -1043,44 +1042,11 @@ static const sd_bus_vtable timedate_vtable[] = {
SD_BUS_PROPERTY("NTPSynchronized", "b", property_get_ntp_sync, 0, 0), SD_BUS_PROPERTY("NTPSynchronized", "b", property_get_ntp_sync, 0, 0),
SD_BUS_PROPERTY("TimeUSec", "t", property_get_time, 0, 0), SD_BUS_PROPERTY("TimeUSec", "t", property_get_time, 0, 0),
SD_BUS_PROPERTY("RTCTimeUSec", "t", property_get_rtc_time, 0, 0), SD_BUS_PROPERTY("RTCTimeUSec", "t", property_get_rtc_time, 0, 0),
SD_BUS_METHOD("SetTime", "xbb", NULL, method_set_time, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetTime", SD_BUS_METHOD("SetTimezone", "sb", NULL, method_set_timezone, SD_BUS_VTABLE_UNPRIVILEGED),
"xbb", SD_BUS_METHOD("SetLocalRTC", "bbb", NULL, method_set_local_rtc, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(usec_utc) SD_BUS_METHOD("SetNTP", "bb", NULL, method_set_ntp, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(relative) SD_BUS_METHOD("ListTimezones", NULL, "as", method_list_timezones, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_PARAM(interactive),
NULL,,
method_set_time,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetTimezone",
"sb",
SD_BUS_PARAM(timezone)
SD_BUS_PARAM(interactive),
NULL,,
method_set_timezone,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetLocalRTC",
"bbb",
SD_BUS_PARAM(local_rtc)
SD_BUS_PARAM(fix_system)
SD_BUS_PARAM(interactive),
NULL,,
method_set_local_rtc,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("SetNTP",
"bb",
SD_BUS_PARAM(use_ntp)
SD_BUS_PARAM(interactive),
NULL,,
method_set_ntp,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("ListTimezones",
NULL,,
"as",
SD_BUS_PARAM(timezones),
method_list_timezones,
SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END, SD_BUS_VTABLE_END,
}; };

View File

@ -1,250 +0,0 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1+
import collections
import sys
import shlex
import subprocess
import io
import pprint
from lxml import etree
PARSER = etree.XMLParser(no_network=True,
remove_comments=False,
strip_cdata=False,
resolve_entities=False)
PRINT_ERRORS = True
class NoCommand(Exception):
pass
def find_command(lines):
acc = []
for num, line in enumerate(lines):
# skip empty leading line
if num == 0 and not line:
continue
cont = line.endswith('\\')
if cont:
line = line[:-1].rstrip()
acc.append(line if not acc else line.lstrip())
if not cont:
break
joined = ' '.join(acc)
if not joined.startswith('$ '):
raise NoCommand
return joined[2:], lines[:num+1] + [''], lines[-1]
BORING_INTERFACES = [
'org.freedesktop.DBus.Peer',
'org.freedesktop.DBus.Introspectable',
'org.freedesktop.DBus.Properties',
]
def print_method(declarations, elem, *, prefix, file, is_signal=False):
name = elem.get('name')
klass = 'signal' if is_signal else 'method'
declarations[klass].append(name)
print(f'''{prefix}{name}(''', file=file, end='')
lead = ',\n' + prefix + ' ' * len(name) + ' '
for num, arg in enumerate(elem.findall('./arg')):
argname = arg.get('name')
if argname is None:
if PRINT_ERRORS:
print(f'method {name}: argument {num+1} has no name', file=sys.stderr)
argname = 'UNNAMED'
type = arg.get('type')
if not is_signal:
direction = arg.get('direction')
print(f'''{lead if num > 0 else ''}{direction:3} {type} {argname}''', file=file, end='')
else:
print(f'''{lead if num > 0 else ''}{type} {argname}''', file=file, end='')
print(f');', file=file)
ACCESS_MAP = {
'read' : 'readonly',
'write' : 'readwrite',
}
def value_ellipsis(type):
if type == 's':
return "'...'";
if type[0] == 'a':
inner = value_ellipsis(type[1:])
return f"[{inner}{', ...' if inner != '...' else ''}]";
return '...'
def print_property(declarations, elem, *, prefix, file):
name = elem.get('name')
type = elem.get('type')
access = elem.get('access')
declarations['property'].append(name)
# @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
# @org.freedesktop.systemd1.Privileged("true")
# readwrite b EnableWallMessages = false;
for anno in elem.findall('./annotation'):
anno_name = anno.get('name')
anno_value = anno.get('value')
print(f'''{prefix}@{anno_name}("{anno_value}")''', file=file)
access = ACCESS_MAP.get(access, access)
print(f'''{prefix}{access} {type} {name} = {value_ellipsis(type)};''', file=file)
def print_interface(iface, *, prefix, file, print_boring, only_interface, declarations):
name = iface.get('name')
is_boring = (name in BORING_INTERFACES or
only_interface is not None and name != only_interface)
if is_boring and print_boring:
print(f'''{prefix}interface {name} {{ ... }};''', file=file)
elif not is_boring and not print_boring:
print(f'''{prefix}interface {name} {{''', file=file)
prefix2 = prefix + ' '
for num, elem in enumerate(iface.findall('./method')):
if num == 0:
print(f'''{prefix2}methods:''', file=file)
print_method(declarations, elem, prefix=prefix2 + ' ', file=file)
for num, elem in enumerate(iface.findall('./signal')):
if num == 0:
print(f'''{prefix2}signals:''', file=file)
print_method(declarations, elem, prefix=prefix2 + ' ', file=file, is_signal=True)
for num, elem in enumerate(iface.findall('./property')):
if num == 0:
print(f'''{prefix2}properties:''', file=file)
print_property(declarations, elem, prefix=prefix2 + ' ', file=file)
print(f'''{prefix}}};''', file=file)
def document_has_elem_with_text(document, elem, item_repr):
predicate = f".//{elem}" # [text() = 'foo'] doesn't seem supported :(
for loc in document.findall(predicate):
if loc.text == item_repr:
return True
else:
return False
def check_documented(document, declarations):
missing = []
for klass, items in declarations.items():
for item in items:
if klass == 'method':
elem = 'function'
item_repr = f'{item}()'
elif klass == 'signal':
elem = 'function'
item_repr = item
elif klass == 'property':
elem = 'varname'
item_repr = item
else:
assert False, (klass, item)
if not document_has_elem_with_text(document, elem, item_repr):
if PRINT_ERRORS:
print(f'{klass} {item} is not documented :(')
missing.append((klass, item))
return missing
def xml_to_text(destination, xml, *, only_interface=None):
file = io.StringIO()
declarations = collections.defaultdict(list)
print(f'''node {destination} {{''', file=file)
for print_boring in [False, True]:
for iface in xml.findall('./interface'):
print_interface(iface, prefix=' ', file=file,
print_boring=print_boring,
only_interface=only_interface,
declarations=declarations)
print(f'''}};''', file=file)
return file.getvalue(), declarations
def subst_output(document, programlisting):
try:
cmd, prefix_lines, footer = find_command(programlisting.text.splitlines())
except NoCommand:
return
only_interface = programlisting.get('interface', None)
argv = shlex.split(cmd)
argv += ['--xml']
print(f'COMMAND: {shlex.join(argv)}')
object_idx = argv.index('--object-path')
object_path = argv[object_idx + 1]
try:
out = subprocess.check_output(argv, text=True)
except subprocess.CalledProcessError:
print('command failed, ignoring', file=sys.stderr)
return
xml = etree.fromstring(out, parser=PARSER)
new_text, declarations = xml_to_text(object_path, xml, only_interface=only_interface)
programlisting.text = '\n'.join(prefix_lines) + '\n' + new_text + footer
if declarations:
missing = check_documented(document, declarations)
parent = programlisting.getparent()
# delete old comments
for child in parent:
if (child.tag == etree.Comment
and 'not documented' in child.text):
parent.remove(child)
# insert comments for undocumented items
for item in reversed(missing):
comment = etree.Comment(f'{item[0]} {item[1]} is not documented!')
comment.tail = programlisting.tail
parent.insert(parent.index(programlisting) + 1, comment)
def process(page):
src = open(page).read()
xml = etree.fromstring(src, parser=PARSER)
# print('parsing {}'.format(name), file=sys.stderr)
if xml.tag != 'refentry':
return
pls = xml.findall('.//programlisting')
for pl in pls:
subst_output(xml, pl)
out_text = etree.tostring(xml, encoding='unicode')
# massage format to avoid some lxml whitespace handling idiosyncracies
# https://bugs.launchpad.net/lxml/+bug/526799
out_text = (src[:src.find('<refentryinfo')] +
out_text[out_text.find('<refentryinfo'):] +
'\n')
with open(page, 'w') as out:
out.write(out_text)
if __name__ == '__main__':
pages = sys.argv[1:]
for page in pages:
process(page)