Compare commits

...

18 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 92cad3f82d
Merge pull request #15406 from DaanDeMeyer/sd-bus-set-exec-docs
Add sd_bus_set_exec docs
2020-04-12 18:38:49 +02:00
Daan De Meyer 3415b0cc8a sd-bus: Add sd_bus_set_exec docs 2020-04-12 17:24:01 +02:00
Vito Caputo ea7cbf5bdd home: switch to BusLocator-oriented helpers
Remove some unnecessary verbosity, largely mechanical change with
no functional difference.
2020-04-12 17:24:00 +02:00
Ross Lagerwall 964df69bd5 hwdb: Add accel orientation quirk for Geoflex laptop
Add a quirk to fix the accelerometer orientation on the Geoflex laptop
so that the display is upright rather than upside-down.
2020-04-12 17:16:55 +02:00
Zbigniew Jędrzejewski-Szmek a1a11d5610
Merge pull request #15365 from poettering/remount-fs-pstore-fix
pid1: automatically generate systemd-remount-fs.service deps, plus enable systemd-pstore from sysinit.target
2020-04-12 17:16:07 +02:00
Zbigniew Jędrzejewski-Szmek b15b4376af
Merge pull request #15405 from DaanDeMeyer/sd-bus-can-send-docs
Add sd_bus_can_send docs
2020-04-12 17:05:05 +02:00
Zbigniew Jędrzejewski-Szmek e5a12c4961
Merge pull request #15399 from DaanDeMeyer/sd-bus-property-docs
sd_bus_get/set_property docs
2020-04-12 17:02:55 +02:00
Daan De Meyer 59a77060e0 sd-bus: Use pointer syntax for sd_bus_set_exec argv parameter 2020-04-11 21:57:28 +02:00
Daan De Meyer 3258aa750e sd-bus: Add sd_bus_can_send docs 2020-04-11 21:25:39 +02:00
Daan De Meyer 535f1d0492 sd-bus: Fix sd_bus_close.xml line wrapping 2020-04-11 21:09:20 +02:00
Daan De Meyer eb74579d09 meson: Exclude more deprecated functions from check-api-docs 2020-04-11 21:08:34 +02:00
Daan De Meyer 4b7f8d78de sd-bus: Add sd_bus_get/set_property docs 2020-04-11 19:10:54 +02:00
Daan De Meyer 7f782005e5 sd-bus: sd_bus_message_append fixes 2020-04-10 21:31:29 +02:00
Lennart Poettering b0c1a07654 units: make sure systemd-pstore stops at shutdown
This doesn't matter too much given that the service doesn't do anything
on shutdown, but let's still stop it to make things cleaner.
2020-04-08 16:29:58 +02:00
Lennart Poettering e0f968ad96 units: drop systemd-remount-fs.service dependency from more services
All services using StateDirectory= don't need the explicit dep anymore,
let's hence drop it everywhere.
2020-04-08 16:29:41 +02:00
Lennart Poettering 0c978faa16 units: drop dependency on systemd-remount-fs.service from systemd-pstore.service
This dependency is now generated automatically given we use
StateDirectory=. Moreover the combination of Wants= and After= was too
strong anway, as whether remount-fs is pulled in or not should not be up
to systemd-pstore.service, and in fact is part of the initial
transaction anyway.
2020-04-08 16:29:40 +02:00
Lennart Poettering f3b7a79b97 core: automatically add dependency on systemd-remount-fs.service if StateDirectory= is used
And similar for other settings that require a writable /var/.

Rationale: if these options are used for early-boot services (such as
systemd-pstore.service) we need /var/ writable. And if /var/ is on the
root fs, then systemd-remount-fs.service is the service that ensures
that /var/ is writable.

This allows us to remove explicit deps in services such as
systemd-pstore.service.
2020-04-08 16:29:25 +02:00
Lennart Poettering 167241912f units: pull in systemd-pstore.service from sysinit.target
sysinit.target is the target our early boot services are generally
pulled in from, make systemd-pstore.service not an exception of that.

Effectively this doesn't mean much, either way our unit is part of the
initial transaction.
2020-04-08 16:29:24 +02:00
20 changed files with 402 additions and 223 deletions

View File

@ -283,6 +283,14 @@ sensor:modalias:acpi:ACCE0001*:dmi:*svnEndless*:*pnELT-NL3*
sensor:modalias:acpi:KIOX000A*:dmi:*:svnEVE*:pnEveV:*
ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
#########################################
# Geo Computers
#########################################
# Geoflex
sensor:modalias:acpi:KIOX010A*:dmi:*:svnGEO*:pnGeoFlex*:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, 1
#########################################
# Google Chromebooks
#########################################

View File

@ -146,6 +146,7 @@ manpages = [
'sd_bus_call_method_asyncv',
'sd_bus_call_methodv'],
''],
['sd_bus_can_send', '3', [], ''],
['sd_bus_close', '3', ['sd_bus_default_flush_close', 'sd_bus_flush'], ''],
['sd_bus_creds_get_pid',
'3',
@ -342,7 +343,7 @@ manpages = [
'sd_bus_request_name_async'],
''],
['sd_bus_send', '3', [], ''],
['sd_bus_set_address', '3', ['sd_bus_get_address'], ''],
['sd_bus_set_address', '3', ['sd_bus_get_address', 'sd_bus_set_exec'], ''],
['sd_bus_set_close_on_exit', '3', ['sd_bus_get_close_on_exit'], ''],
['sd_bus_set_connected_signal', '3', ['sd_bus_get_connected_signal'], ''],
['sd_bus_set_description',
@ -359,6 +360,14 @@ manpages = [
'3',
['sd_bus_get_method_call_timeout'],
''],
['sd_bus_set_property',
'3',
['sd_bus_get_property',
'sd_bus_get_property_string',
'sd_bus_get_property_strv',
'sd_bus_get_property_trivial',
'sd_bus_set_propertyv'],
''],
['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''],
['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''],
['sd_bus_slot_get_bus',

View File

@ -50,6 +50,7 @@
<citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call_method_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_can_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_creds_get_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_close</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@ -70,6 +71,10 @@
<citerefentry><refentrytitle>sd_bus_message_dump</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_cookie</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_property</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_property_trivial</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_property_string</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_property_strv</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_signature</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_type</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@ -99,6 +104,8 @@
<citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_method_call_timeout</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_property</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_propertyv</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_bus_set_close_on_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

View File

@ -133,7 +133,7 @@
<citerefentry><refentrytitle>sd_bus_message_new_method_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd_bus_set_property</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
</para>
</refsect1>

93
man/sd_bus_can_send.xml Normal file
View File

@ -0,0 +1,93 @@
<?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="sd_bus_can_send"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_bus_can_send</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>sd_bus_can_send</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_bus_can_send</refname>
<refpurpose>Check which types can be sent over a bus object</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>void <function>sd_bus_can_send</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>char <parameter>type</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_bus_can_send</function> is mostly used for checking if file descriptor
passing is available on the given bus. <parameter>type</parameter> can be any of the
<constant>SD_BUS_TYPE</constant> constants.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On failure, <function>sd_bus_can_send()</function> returns a negative errno-style error
code. If values of the given type can be sent over the given bus, it returns a positive integer.
Otherwise, it returns zero.</para>
<refsect2>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-ENOPKG</constant></term>
<listitem><para>The bus object <parameter>bus</parameter> could not be resolved.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOTCONN</constant></term>
<listitem><para>The input parameter <parameter>bus</parameter> is
<constant>NULL</constant> or the bus is not connected.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The bus object <parameter>bus</parameter> was created in a different
process.</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -48,39 +48,44 @@
<refsect1>
<title>Description</title>
<para><function>sd_bus_close()</function> disconnects the specified bus connection. When this call is invoked and
the specified bus object refers to an active connection it is immediately terminated. No further messages may be
sent or received on it. Any messages queued in the bus object (both incoming and outgoing) are released. If
invoked on <constant>NULL</constant> bus object or when the bus connection is already closed this function executes
no operation. This call does not free or unreference the bus object itself. Use
<citerefentry><refentrytitle>sd_bus_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry> for that.</para>
<para><function>sd_bus_close()</function> disconnects the specified bus connection. When this
call is invoked and the specified bus object refers to an active connection it is immediately
terminated. No further messages may be sent or received on it. Any messages queued in the bus
object (both incoming and outgoing) are released. If invoked on <constant>NULL</constant> bus
object or when the bus connection is already closed this function executes no operation. This
call does not free or unreference the bus object itself. Use
<citerefentry><refentrytitle>sd_bus_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for that.</para>
<para><function>sd_bus_flush()</function> synchronously writes out all outgoing queued message on a bus connection
if there are any. This function call may block if the peer is not processing bus messages quickly.</para>
<para><function>sd_bus_flush()</function> synchronously writes out all outgoing queued message
on a bus connection if there are any. This function call may block if the peer is not processing
bus messages quickly.</para>
<para>Before a program exits it is usually a good idea to flush any pending messages with
<function>sd_bus_flush()</function> and then close connections with <function>sd_bus_close()</function> to ensure
that no unwritten messages are lost, no further messages may be queued and all incoming but unprocessed messages
are released. After both operations have been done, it is a good idea to also drop any remaining references to the
bus object so that it may be freed. Since these three operations are frequently done together a helper call
<citerefentry><refentrytitle>sd_bus_flush_close_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry> is
provided that combines them into one.</para>
<function>sd_bus_flush()</function> and then close connections with
<function>sd_bus_close()</function> to ensure that no unwritten messages are lost, no further
messages may be queued and all incoming but unprocessed messages are released. After both
operations have been done, it is a good idea to also drop any remaining references to the bus
object so that it may be freed. Since these three operations are frequently done together a
helper call
<citerefentry><refentrytitle>sd_bus_flush_close_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
is provided that combines them into one.</para>
<para><function>sd_bus_default_flush_close()</function> is similar to
<function>sd_bus_flush_close_unref</function>, but does not take a bus pointer argument and instead
iterates over any of the "default" busses opened by
<function>sd_bus_flush_close_unref</function>, but does not take a bus pointer argument and
instead iterates over any of the "default" busses opened by
<citerefentry><refentrytitle>sd_bus_default</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_default_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_default_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
and similar calls. <function>sd_bus_default_flush_close()</function> is particularly useful to clean up
any busses opened using those calls before the program exits.</para>
and similar calls. <function>sd_bus_default_flush_close()</function> is particularly useful to
clean up any busses opened using those calls before the program exits.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_bus_flush()</function> returns 0 or a positive integer. On failure, it returns a
negative errno-style error code.</para>
<para>On success, <function>sd_bus_flush()</function> returns a non-negative integer. On
failure, it returns a negative errno-style error code.</para>
<refsect2>
<title>Errors</title>
@ -91,7 +96,8 @@
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The bus connection has been created in a different process.</para></listitem>
<listitem><para>The bus connection has been created in a different process.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

View File

@ -80,7 +80,7 @@
dictionary entries, followed by a pair of values for each entry matching the element type of the
dictionary entries.</para>
<para>The <function>sd_bus_message_appendv()</function> is equivalent to the
<para><function>sd_bus_message_appendv()</function> is equivalent to
<function>sd_bus_message_append()</function>, except that it is called with a
<literal>va_list</literal> instead of a variable number of arguments. This function does not
call the <function>va_end()</function> macro. Because it invokes the

View File

@ -19,6 +19,7 @@
<refnamediv>
<refname>sd_bus_set_address</refname>
<refname>sd_bus_get_address</refname>
<refname>sd_bus_set_exec</refname>
<refpurpose>Set or query the address of the bus connection</refpurpose>
</refnamediv>
@ -39,6 +40,12 @@
<paramdef>const char **<parameter>address</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_set_exec</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>char *const *<parameter>argv</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@ -104,6 +111,11 @@
automatically by
<citerefentry><refentrytitle>sd_bus_open</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
similar calls, based on environment variables or built-in defaults.</para>
<para><function>sd_bus_set_exec</function> is a shorthand function for setting a
<literal>unixexec</literal> address that spawns the given executable with the given arguments.
If <parameter>argv</parameter> is <constant>NULL</constant>, the given executable is spawned
without any extra arguments.</para>
</refsect1>
<refsect1>

176
man/sd_bus_set_property.xml Normal file
View File

@ -0,0 +1,176 @@
<?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="sd_bus_set_property"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_bus_set_property</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>sd_bus_set_property</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_bus_set_property</refname>
<refname>sd_bus_set_propertyv</refname>
<refname>sd_bus_get_property</refname>
<refname>sd_bus_get_property_trivial</refname>
<refname>sd_bus_get_property_string</refname>
<refname>sd_bus_get_property_strv</refname>
<refpurpose>Set or query D-Bus service properties</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sd_bus_set_property</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>sd_bus_message **<parameter>reply</parameter></paramdef>
<paramdef>const char *<parameter>type</parameter></paramdef>
<paramdef>...</paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_set_propertyv</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>sd_bus_message **<parameter>reply</parameter></paramdef>
<paramdef>const char *<parameter>type</parameter></paramdef>
<paramdef>va_list <parameter>ap</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_get_property</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>sd_bus_message **<parameter>reply</parameter></paramdef>
<paramdef>const char *<parameter>type</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_get_property_trivial</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>char <parameter>type</parameter></paramdef>
<paramdef>void *<parameter>ret_ptr</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_get_property_string</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>char **<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_get_property_strv</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>destination</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>member</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
<paramdef>char ***<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>These functions set or query D-Bus properties. D-Bus properties are service fields exposed
via the <constant>org.freedesktop.DBus.Properties</constant> interface. Under the hood, these
functions call methods of the <constant>org.freedesktop.DBus.Properties</constant> interface and
as a result their semantics are similar to
<citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para><function>sd_bus_set_property()</function> sets a D-Bus property. On success, the response
is stored in <parameter>reply</parameter>. If setting the property fails or an internal error
occurs, an error is returned and an extended description of the error is optionally stored in
<parameter>ret_error</parameter> if it is not <constant>NULL</constant>.
<parameter>type</parameter> and the arguments that follow it describe the new value of the
property and must follow the format described in
<citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para><function>sd_bus_set_propertyv()</function> is equivalent to
<function>sd_bus_set_property()</function>, except that it is called with a
<literal>va_list</literal> instead of a variable number of arguments.</para>
<para><function>sd_bus_get_property()</function> queries a D-Bus property. If retrieving the
property fails or an internal error occurs, an error is returned and an extended description of
the error is optionally stored in <parameter>ret_error</parameter> if it is not
<constant>NULL</constant>. On success, the property is stored in <parameter>reply</parameter>.
<parameter>type</parameter> describes the property type and must follow the format described in
<citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para><function>sd_bus_get_property_trivial()</function>,
<function>sd_bus_get_property_string()</function> and
<function>sd_bus_get_property_strv()</function> are shorthands for
<function>sd_bus_get_property()</function> that are used to query basic, string and string
vector properties respectively. The caller is responsible for freeing the string and string
vector results stored in <parameter>ret</parameter> by
<function>sd_bus_get_property_string()</function> and
<function>sd_bus_get_property_strv()</function>.</para>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, these functions return a non-negative integer. On failure, they return a
negative errno-style error code.</para>
<refsect2 id='errors'>
<title>Errors</title>
<para>See the
<citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>
man page for a list of possible errors</para>
</refsect2>
</refsect1>
<xi:include href="libsystemd-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call_method</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@ -1055,6 +1055,16 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
if (!MANAGER_IS_SYSTEM(u->manager))
return 0;
/* For the following three directory types we need write access, and /var/ is possibly on the root
* fs. Hence order after systemd-remount-fs.service, to ensure things are writable. */
if (!strv_isempty(c->directories[EXEC_DIRECTORY_STATE].paths) ||
!strv_isempty(c->directories[EXEC_DIRECTORY_CACHE].paths) ||
!strv_isempty(c->directories[EXEC_DIRECTORY_LOGS].paths)) {
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, true, UNIT_DEPENDENCY_FILE);
if (r < 0)
return r;
}
if (c->private_tmp) {
const char *p;

View File

@ -66,6 +66,12 @@ static enum {
EXPORT_FORMAT_MINIMAL, /* also strip signature */
} arg_export_format = EXPORT_FORMAT_FULL;
static const BusLocator home_mgr = {
.destination = "org.freedesktop.home1",
.path = "/org/freedesktop/home1",
.interface = "org.freedesktop.home1.Manager",
};
STATIC_DESTRUCTOR_REGISTER(arg_identity_extra, json_variant_unrefp);
STATIC_DESTRUCTOR_REGISTER(arg_identity_extra_this_machine, json_variant_unrefp);
STATIC_DESTRUCTOR_REGISTER(arg_identity_extra_privileged, json_variant_unrefp);
@ -116,15 +122,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
if (r < 0)
return r;
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ListHomes",
&error,
&reply,
NULL);
r = bus_call_method(bus, &home_mgr, "ListHomes", &error, &reply, NULL);
if (r < 0)
return log_error_errno(r, "Failed to list homes: %s", bus_error_message(&error, r));
@ -387,13 +385,7 @@ static int activate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ActivateHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ActivateHome");
if (r < 0)
return bus_log_create_error(r);
@ -435,13 +427,7 @@ static int deactivate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"DeactivateHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "DeactivateHome");
if (r < 0)
return bus_log_create_error(r);
@ -548,27 +534,9 @@ static int inspect_home(int argc, char *argv[], void *userdata) {
continue;
}
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"GetUserRecordByName",
&error,
&reply,
"s",
*i);
r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", *i);
} else {
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"GetUserRecordByUID",
&error,
&reply,
"u",
(uint32_t) uid);
r = bus_call_method(bus, &home_mgr, "GetUserRecordByUID", &error, &reply, "u", (uint32_t) uid);
}
if (r < 0) {
@ -643,13 +611,7 @@ static int authenticate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"AuthenticateHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "AuthenticateHome");
if (r < 0)
return bus_log_create_error(r);
@ -1470,13 +1432,7 @@ static int create_home(int argc, char *argv[], void *userdata) {
if (r < 0)
return r;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"CreateHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "CreateHome");
if (r < 0)
return bus_log_create_error(r);
@ -1525,13 +1481,7 @@ static int remove_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"RemoveHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "RemoveHome");
if (r < 0)
return bus_log_create_error(r);
@ -1594,16 +1544,7 @@ static int acquire_updated_home_record(
if (!identity_properties_specified())
return log_error_errno(SYNTHETIC_ERRNO(EALREADY), "No field to change specified.");
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"GetUserRecordByName",
&error,
&reply,
"s",
username);
r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", username);
if (r < 0)
return log_error_errno(r, "Failed to acquire user home record: %s", bus_error_message(&error, r));
@ -1689,13 +1630,7 @@ static int update_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_free_ char *formatted = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"UpdateHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "UpdateHome");
if (r < 0)
return bus_log_create_error(r);
@ -1730,13 +1665,7 @@ static int update_home(int argc, char *argv[], void *userdata) {
log_debug("Resizing");
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ResizeHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ResizeHome");
if (r < 0)
return bus_log_create_error(r);
@ -1769,13 +1698,7 @@ static int update_home(int argc, char *argv[], void *userdata) {
log_debug("Propagating password");
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ChangePasswordHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ChangePasswordHome");
if (r < 0)
return bus_log_create_error(r);
@ -1847,13 +1770,7 @@ static int passwd_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ChangePasswordHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ChangePasswordHome");
if (r < 0)
return bus_log_create_error(r);
@ -1932,13 +1849,7 @@ static int resize_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ResizeHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ResizeHome");
if (r < 0)
return bus_log_create_error(r);
@ -1975,13 +1886,7 @@ static int lock_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"LockHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "LockHome");
if (r < 0)
return bus_log_create_error(r);
@ -2020,13 +1925,7 @@ static int unlock_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"UnlockHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "UnlockHome");
if (r < 0)
return bus_log_create_error(r);
@ -2089,13 +1988,7 @@ static int with_home(int argc, char *argv[], void *userdata) {
return log_oom();
for (;;) {
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"AcquireHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "AcquireHome");
if (r < 0)
return bus_log_create_error(r);
@ -2135,16 +2028,7 @@ static int with_home(int argc, char *argv[], void *userdata) {
}
}
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"GetHomeByName",
&error,
&reply,
"s",
argv[1]);
r = bus_call_method(bus, &home_mgr, "GetHomeByName", &error, &reply, "s", argv[1]);
if (r < 0)
return log_error_errno(r, "Failed to inspect home: %s", bus_error_message(&error, r));
@ -2171,13 +2055,7 @@ static int with_home(int argc, char *argv[], void *userdata) {
/* Close the fd that pings the home now. */
acquired_fd = safe_close(acquired_fd);
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ReleaseHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ReleaseHome");
if (r < 0)
return bus_log_create_error(r);
@ -2206,13 +2084,7 @@ static int lock_all_homes(int argc, char *argv[], void *userdata) {
if (r < 0)
return r;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"LockAllHomes");
r = bus_message_new_method_call(bus, &m, &home_mgr, "LockAllHomes");
if (r < 0)
return bus_log_create_error(r);

View File

@ -6,6 +6,7 @@
#include "sd-bus.h"
#include "bus-common-errors.h"
#include "bus-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "home-util.h"
@ -22,6 +23,12 @@
#define USER_RECORD_IS_HOMED INT_TO_PTR(1)
#define USER_RECORD_IS_OTHER INT_TO_PTR(2)
static const BusLocator home_mgr = {
.destination = "org.freedesktop.home1",
.path = "/org/freedesktop/home1",
.interface = "org.freedesktop.home1.Manager",
};
static int parse_argv(
pam_handle_t *handle,
int argc, const char **argv,
@ -121,16 +128,7 @@ static int acquire_user_record(
if (r != PAM_SUCCESS)
return r;
r = sd_bus_call_method(
bus,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"GetUserRecordByName",
&error,
&reply,
"s",
username);
r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", username);
if (r < 0) {
if (sd_bus_error_has_name(&error, SD_BUS_ERROR_SERVICE_UNKNOWN) ||
sd_bus_error_has_name(&error, SD_BUS_ERROR_NAME_HAS_NO_OWNER)) {
@ -456,13 +454,7 @@ static int acquire_home(
}
}
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
do_auth ? "AcquireHome" : "RefHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, do_auth ? "AcquireHome" : "RefHome");
if (r < 0)
return pam_bus_log_create_error(handle, r);
@ -671,13 +663,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
if (r != PAM_SUCCESS)
return r;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ReleaseHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ReleaseHome");
if (r < 0)
return pam_bus_log_create_error(handle, r);
@ -903,13 +889,7 @@ _public_ PAM_EXTERN int pam_sm_chauthtok(
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
r = sd_bus_message_new_method_call(
bus,
&m,
"org.freedesktop.home1",
"/org/freedesktop/home1",
"org.freedesktop.home1.Manager",
"ChangePasswordHome");
r = bus_message_new_method_call(bus, &m, &home_mgr, "ChangePasswordHome");
if (r < 0)
return pam_bus_log_create_error(handle, r);

View File

@ -284,7 +284,7 @@ _public_ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) {
return 0;
}
_public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) {
_public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const *argv) {
_cleanup_strv_free_ char **a = NULL;
int r;

View File

@ -143,7 +143,7 @@ int sd_bus_new(sd_bus **ret);
int sd_bus_set_address(sd_bus *bus, const char *address);
int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd);
int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]);
int sd_bus_set_exec(sd_bus *bus, const char *path, char *const *argv);
int sd_bus_get_address(sd_bus *bus, const char **address);
int sd_bus_set_bus_client(sd_bus *bus, int b);
int sd_bus_is_bus_client(sd_bus *bus);

View File

@ -6,7 +6,14 @@ sd_total=0
udev_good=0
udev_total=0
for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv sd_bus_try_close | sort -u` ; do
deprecated="
-e sd_bus_try_close
-e sd_bus_process_priority
-e sd_bus_message_get_priority
-e sd_bus_message_set_priority
"
for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv $deprecated | sort -u` ; do
if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then
echo "✓ Symbol $symbol() is documented."
good=1

View File

@ -12,7 +12,6 @@ Description=Load/Save Screen Backlight Brightness of %i
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=sysinit.target shutdown.target
[Service]

View File

@ -12,7 +12,7 @@ Description=Process Core Dump
Documentation=man:systemd-coredump(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service systemd-journald.socket
After=systemd-journald.socket
Requires=systemd-journald.socket
Before=shutdown.target

View File

@ -13,8 +13,8 @@ Documentation=man:systemd-pstore(8)
ConditionDirectoryNotEmpty=/sys/fs/pstore
ConditionVirtualization=!container
DefaultDependencies=no
Wants=systemd-remount-fs.service
After=systemd-remount-fs.service
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
[Service]
Type=oneshot
@ -23,4 +23,4 @@ RemainAfterExit=yes
StateDirectory=systemd/pstore
[Install]
WantedBy=systemd-remount-fs.service
WantedBy=sysinit.target

View File

@ -13,7 +13,7 @@ Documentation=man:systemd-rfkill.service(8)
DefaultDependencies=no
BindsTo=sys-devices-virtual-misc-rfkill.device
Conflicts=shutdown.target
After=sys-devices-virtual-misc-rfkill.device systemd-remount-fs.service
After=sys-devices-virtual-misc-rfkill.device
Before=shutdown.target
[Service]

View File

@ -13,7 +13,7 @@ Documentation=man:systemd-timesyncd.service(8)
ConditionCapability=CAP_SYS_TIME
ConditionVirtualization=!container
DefaultDependencies=no
After=systemd-remount-fs.service systemd-sysusers.service
After=systemd-sysusers.service
Before=time-set.target sysinit.target shutdown.target
Conflicts=shutdown.target
Wants=time-set.target time-sync.target