DumpUnitsMatchingPatterns(in as patterns,
out s output);
DumpByFileDescriptor(out h fd);
+ DumpUnitsMatchingPatternsByFileDescriptor(in as patterns,
+ out h fd);
Reload();
@org.freedesktop.DBus.Method.NoReply("true")
Reexecute();
<variablelist class="dbus-method" generated="True" extra-ref="DumpByFileDescriptor()"/>
+ <variablelist class="dbus-method" generated="True" extra-ref="DumpUnitsMatchingPatternsByFileDescriptor()"/>
+
<variablelist class="dbus-method" generated="True" extra-ref="Reload()"/>
<variablelist class="dbus-method" generated="True" extra-ref="Reexecute()"/>
string guaranteed, and new fields may be added any time, and old fields removed. The general structure
may be rearranged drastically between releases. This is exposed by
<citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
- <command>dump</command> command. Similarly, <function>DumpUnitsMatchingPatterns()</function> returns the internal
- state of units whose names match the glob expressions specified in the <varname>patterns</varname>
- argument. The <function>DumpByFileDescriptor()</function> method is identical to
- <function>Dump()</function> but returns the data serialized into a file descriptor (the client should
- read the text data from it until hitting EOF). Given the size limits on D-Bus messages and the possibly
- large size of the returned string, <function>DumpByFileDescriptor()</function> is usually the
- preferable interface, since it ensures the data can be passed reliably from the service manager to the
- client. (Note though that <function>DumpByFileDescriptor()</function> cannot work when communicating
- with the service manager remotely, as file descriptors are strictly local to a system.)</para>
+ <command>dump</command> command. Similarly, <function>DumpUnitsMatchingPatterns()</function> returns
+ the internal state of units whose names match the glob expressions specified in the
+ <varname>patterns</varname> argument. The
+ <function>DumpByFileDescriptor()</function>/<function>DumpUnitsMatchingPatternsByFileDescriptor()</function>
+ methods are identical to <function>Dump()</function>/<function>DumpUnitsMatchingPatterns()</function>,
+ but return data serialized into a file descriptor (the client should read the text data from it until
+ hitting EOF). Given the size limits on D-Bus messages and the possibly large size of the returned
+ strings,
+ <function>DumpByFileDescriptor()</function>/<function>DumpUnitsMatchingPatternsByFileDescriptor()</function>
+ are usually the preferred interface, since it ensures the data can be passed reliably from the service
+ manager to the client. Note though that they cannot work when communicating with the service manager
+ remotely, as file descriptors are strictly local to a system.</para>
<para><function>Reload()</function> may be invoked to reload all unit files.</para>
return dump_impl(message, userdata, error, NULL, reply_dump_by_fd);
}
-static int method_dump_units_matching_patterns(sd_bus_message *message, void *userdata, sd_bus_error *error) {
+static int dump_units_matching_patterns(
+ sd_bus_message *message,
+ void *userdata,
+ sd_bus_error *error,
+ int (*reply)(sd_bus_message *, char *)) {
_cleanup_strv_free_ char **patterns = NULL;
int r;
if (r < 0)
return r;
- return dump_impl(message, userdata, error, patterns, reply_dump);
+ return dump_impl(message, userdata, error, patterns, reply);
+}
+
+static int method_dump_units_matching_patterns(sd_bus_message *message, void *userdata, sd_bus_error *error) {
+ return dump_units_matching_patterns(message, userdata, error, reply_dump);
+}
+
+static int method_dump_units_matching_patterns_by_fd(sd_bus_message *message, void *userdata, sd_bus_error *error) {
+ return dump_units_matching_patterns(message, userdata, error, reply_dump_by_fd);
}
static int method_refuse_snapshot(sd_bus_message *message, void *userdata, sd_bus_error *error) {
SD_BUS_RESULT("h", fd),
method_dump_by_fd,
SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD_WITH_ARGS("DumpUnitsMatchingPatternsByFileDescriptor",
+ SD_BUS_ARGS("as", patterns),
+ SD_BUS_RESULT("h", fd),
+ method_dump_units_matching_patterns_by_fd,
+ SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_ARGS("CreateSnapshot",
SD_BUS_ARGS("s", name, "b", cleanup),
SD_BUS_RESULT("o", unit),
send_interface="org.freedesktop.systemd1.Manager"
send_member="DumpUnitsMatchingPatterns"/>
+ <allow send_destination="org.freedesktop.systemd1"
+ send_interface="org.freedesktop.systemd1.Manager"
+ send_member="DumpUnitsMatchingPatternsByFileDescriptor"/>
+
<allow send_destination="org.freedesktop.systemd1"
send_interface="org.freedesktop.systemd1.Manager"
send_member="ListUnitFiles"/>