summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/dbus-manager.c43
-rw-r--r--src/core/dbus-manager.h1
-rw-r--r--src/core/dbus.c4
-rw-r--r--src/home/homed-manager.c5
-rw-r--r--src/hostname/hostnamed.c5
-rw-r--r--src/import/importd.c5
-rw-r--r--src/locale/localed.c5
-rw-r--r--src/login/logind.c5
-rw-r--r--src/machine/machined.c5
-rw-r--r--src/network/networkd-manager.c5
-rw-r--r--src/portable/portabled.c5
-rw-r--r--src/resolve/resolvectl.c8
-rw-r--r--src/resolve/resolved-bus.c58
-rw-r--r--src/shared/bus-log-control-api.c123
-rw-r--r--src/shared/bus-log-control-api.h13
-rw-r--r--src/shared/meson.build6
-rw-r--r--src/timedate/timedated.c5
-rw-r--r--src/timesync/timesyncd-bus.c5
18 files changed, 222 insertions, 84 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 84c251af27..5f862e47fd 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -9,6 +9,7 @@
#include "architecture.h"
#include "build.h"
#include "bus-common-errors.h"
+#include "bus-log-control-api.h"
#include "bus-util.h"
#include "dbus-cgroup.h"
#include "dbus-execute.h"
@@ -50,7 +51,6 @@ BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_oom_policy, oom_policy, OOMPolicy)
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_version, "s", GIT_VERSION);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_features, "s", SYSTEMD_FEATURES);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_architecture, "s", architecture_to_string(uname_architecture()));
-static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_log_target, "s", log_target_to_string(log_get_target()));
static BUS_DEFINE_PROPERTY_GET2(property_get_system_state, "s", Manager, manager_state, manager_state_to_string);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_timer_slack_nsec, "t", (uint64_t) prctl(PR_GET_TIMERSLACK));
static BUS_DEFINE_PROPERTY_GET_REF(property_get_hashmap_size, "u", Hashmap *, hashmap_size);
@@ -141,28 +141,6 @@ static int property_set_log_target(
return 0;
}
-static int property_get_log_level(
- sd_bus *bus,
- const char *path,
- const char *interface,
- const char *property,
- sd_bus_message *reply,
- void *userdata,
- sd_bus_error *error) {
-
- _cleanup_free_ char *t = NULL;
- int r;
-
- assert(bus);
- assert(reply);
-
- r = log_level_to_string_alloc(log_get_max_level(), &t);
- if (r < 0)
- return r;
-
- return sd_bus_message_append(reply, "s", t);
-}
-
static int property_set_log_level(
sd_bus *bus,
const char *path,
@@ -2404,8 +2382,8 @@ const sd_bus_vtable bus_manager_vtable[] = {
BUS_PROPERTY_DUAL_TIMESTAMP("InitRDGeneratorsFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_GENERATORS_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("InitRDUnitsLoadStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_START]), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("InitRDUnitsLoadFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_WRITABLE_PROPERTY("LogLevel", "s", property_get_log_level, property_set_log_level, 0, 0),
- SD_BUS_WRITABLE_PROPERTY("LogTarget", "s", property_get_log_target, property_set_log_target, 0, 0),
+ SD_BUS_WRITABLE_PROPERTY("LogLevel", "s", bus_property_get_log_level, property_set_log_level, 0, 0),
+ SD_BUS_WRITABLE_PROPERTY("LogTarget", "s", bus_property_get_log_target, property_set_log_target, 0, 0),
SD_BUS_PROPERTY("NNames", "u", property_get_hashmap_size, offsetof(Manager, units), 0),
SD_BUS_PROPERTY("NFailedUnits", "u", property_get_set_size, offsetof(Manager, failed_units), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("NJobs", "u", property_get_hashmap_size, offsetof(Manager, jobs), 0),
@@ -3044,6 +3022,21 @@ const sd_bus_vtable bus_manager_vtable[] = {
SD_BUS_VTABLE_END
};
+const sd_bus_vtable bus_manager_log_control_vtable[] = {
+ SD_BUS_VTABLE_START(0),
+
+ /* We define a private version of this interface here, since we want slightly different
+ * implementations for the setters. We'll still use the generic getters however, and we share the
+ * setters with the implementations for the Manager interface above (which pre-dates the generic
+ * service API interface). */
+
+ SD_BUS_WRITABLE_PROPERTY("LogLevel", "s", bus_property_get_log_level, property_set_log_level, 0, 0),
+ SD_BUS_WRITABLE_PROPERTY("LogTarget", "s", bus_property_get_log_target, property_set_log_target, 0, 0),
+ SD_BUS_PROPERTY("SyslogIdentifier", "s", bus_property_get_syslog_identifier, 0, 0),
+
+ SD_BUS_VTABLE_END,
+};
+
static int send_finished(sd_bus *bus, void *userdata) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *message = NULL;
usec_t *times = userdata;
diff --git a/src/core/dbus-manager.h b/src/core/dbus-manager.h
index 10aa2eccee..83854b0f59 100644
--- a/src/core/dbus-manager.h
+++ b/src/core/dbus-manager.h
@@ -6,6 +6,7 @@
#include "manager.h"
extern const sd_bus_vtable bus_manager_vtable[];
+extern const sd_bus_vtable bus_manager_log_control_vtable[];
void bus_manager_send_finished(Manager *m, usec_t firmware_usec, usec_t loader_usec, usec_t kernel_usec, usec_t initrd_usec, usec_t userspace_usec, usec_t total_usec);
void bus_manager_send_reloading(Manager *m, bool active);
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 7791141e52..8a586e1171 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -539,6 +539,10 @@ static int bus_setup_api_vtables(Manager *m, sd_bus *bus) {
if (r < 0)
return log_error_errno(r, "Failed to register Manager vtable: %m");
+ r = sd_bus_add_object_vtable(bus, NULL, "/org/freedesktop/LogControl1", "org.freedesktop.LogControl1", bus_manager_log_control_vtable, m);
+ if (r < 0)
+ return log_error_errno(r, "Failed to register service API vtable: %m");
+
r = sd_bus_add_fallback_vtable(bus, NULL, "/org/freedesktop/systemd1/job", "org.freedesktop.systemd1.Job", bus_job_vtable, bus_job_find, m);
if (r < 0)
return log_error_errno(r, "Failed to register Job vtable: %m");
diff --git a/src/home/homed-manager.c b/src/home/homed-manager.c
index 12422bd733..ed2a54615c 100644
--- a/src/home/homed-manager.c
+++ b/src/home/homed-manager.c
@@ -12,6 +12,7 @@
#include "btrfs-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "clean-ipc.h"
#include "conf-files.h"
@@ -894,6 +895,10 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add object manager: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.home1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index 66af1c0b5c..5b4c74e299 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -8,6 +8,7 @@
#include "alloc-util.h"
#include "bus-common-errors.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "def.h"
#include "env-file-label.h"
@@ -754,6 +755,10 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
if (r < 0)
return log_error_errno(r, "Failed to register object: %m");
+ r = bus_log_control_api_register(bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(bus, NULL, "org.freedesktop.hostname1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/import/importd.c b/src/import/importd.c
index c4e8920169..8977ebd835 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -7,6 +7,7 @@
#include "alloc-util.h"
#include "bus-common-errors.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "def.h"
#include "fd-util.h"
@@ -1308,6 +1309,10 @@ static int manager_add_bus_objects(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add transfer enumerator: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.import1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 3d626f6bcc..7315d93a98 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -14,6 +14,7 @@
#include "alloc-util.h"
#include "bus-error.h"
+#include "bus-log-control-api.h"
#include "bus-message.h"
#include "bus-polkit.h"
#include "def.h"
@@ -724,6 +725,10 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
if (r < 0)
return log_error_errno(r, "Failed to register object: %m");
+ r = bus_log_control_api_register(bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(bus, NULL, "org.freedesktop.locale1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/login/logind.c b/src/login/logind.c
index 8f3708d2a4..75958189ac 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -9,6 +9,7 @@
#include "alloc-util.h"
#include "bus-error.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "cgroup-util.h"
#include "def.h"
@@ -706,6 +707,10 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to enable subscription: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.login1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/machine/machined.c b/src/machine/machined.c
index ace2131c2d..a93bfc42be 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -10,6 +10,7 @@
#include "alloc-util.h"
#include "bus-error.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "cgroup-util.h"
#include "dirent-util.h"
@@ -263,6 +264,10 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to enable subscription: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.machine1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 1348fcb9b3..31bf02f500 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -11,6 +11,7 @@
#include "sd-netlink.h"
#include "alloc-util.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "conf-parser.h"
@@ -165,6 +166,10 @@ int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add network enumerator: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.network1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/portable/portabled.c b/src/portable/portabled.c
index 75b76926e5..265f7a7440 100644
--- a/src/portable/portabled.c
+++ b/src/portable/portabled.c
@@ -7,6 +7,7 @@
#include "sd-daemon.h"
#include "alloc-util.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "def.h"
#include "main-func.h"
@@ -84,6 +85,10 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add image enumerator: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.portable1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
index 831901e9b4..8abaeb5f1c 100644
--- a/src/resolve/resolvectl.c
+++ b/src/resolve/resolvectl.c
@@ -2529,8 +2529,8 @@ static int verb_log_level(int argc, char *argv[], void *userdata) {
r = sd_bus_get_property_string(
bus,
"org.freedesktop.resolve1",
- "/org/freedesktop/resolve1",
- "org.freedesktop.resolve1.Manager",
+ "/org/freedesktop/LogControl1",
+ "org.freedesktop.LogControl1",
"LogLevel",
&error,
&level);
@@ -2545,8 +2545,8 @@ static int verb_log_level(int argc, char *argv[], void *userdata) {
r = sd_bus_set_property(
bus,
"org.freedesktop.resolve1",
- "/org/freedesktop/resolve1",
- "org.freedesktop.resolve1.Manager",
+ "/org/freedesktop/LogControl1",
+ "org.freedesktop.LogControl1",
"LogLevel",
&error,
"s",
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index badb0ee739..f56166b94c 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -2,6 +2,7 @@
#include "alloc-util.h"
#include "bus-common-errors.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "dns-domain.h"
@@ -1836,57 +1837,6 @@ static int bus_method_unregister_service(sd_bus_message *message, void *userdata
return call_dnssd_method(m, message, bus_dnssd_method_unregister, error);
}
-static int property_get_log_level(
- sd_bus *bus,
- const char *path,
- const char *interface,
- const char *property,
- sd_bus_message *reply,
- void *userdata,
- sd_bus_error *error) {
-
- _cleanup_free_ char *t = NULL;
- int r;
-
- assert(bus);
- assert(reply);
-
- r = log_level_to_string_alloc(log_get_max_level(), &t);
- if (r < 0)
- return r;
-
- return sd_bus_message_append(reply, "s", t);
-}
-
-static int property_set_log_level(
- sd_bus *bus,
- const char *path,
- const char *interface,
- const char *property,
- sd_bus_message *value,
- void *userdata,
- sd_bus_error *error) {
-
- const char *t;
- int r;
-
- assert(bus);
- assert(value);
-
- r = sd_bus_message_read(value, "s", &t);
- if (r < 0)
- return r;
-
- r = log_level_from_string(t);
- if (r < 0)
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid log level '%s'", t);
-
- log_info("Setting log level to %s.", t);
- log_set_max_level(r);
-
- return 0;
-}
-
static const sd_bus_vtable resolve_vtable[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("LLMNRHostname", "s", NULL, offsetof(Manager, llmnr_hostname), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
@@ -1905,8 +1855,6 @@ static const sd_bus_vtable resolve_vtable[] = {
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_WRITABLE_PROPERTY("LogLevel", "s", property_get_log_level, property_set_log_level, 0, 0),
-
SD_BUS_METHOD_WITH_NAMES("ResolveHostname",
"isit",
SD_BUS_PARAM(ifindex)
@@ -2121,6 +2069,10 @@ int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to register dnssd enumerator: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.resolve1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/shared/bus-log-control-api.c b/src/shared/bus-log-control-api.c
new file mode 100644
index 0000000000..ffc52c7774
--- /dev/null
+++ b/src/shared/bus-log-control-api.c
@@ -0,0 +1,123 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+
+#include "alloc-util.h"
+#include "bus-log-control-api.h"
+#include "bus-util.h"
+#include "log.h"
+#include "sd-bus.h"
+#include "syslog-util.h"
+
+int bus_property_get_log_level(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *error) {
+
+ _cleanup_free_ char *t = NULL;
+ int r;
+
+ assert(bus);
+ assert(reply);
+
+ r = log_level_to_string_alloc(log_get_max_level(), &t);
+ if (r < 0)
+ return r;
+
+ return sd_bus_message_append(reply, "s", t);
+}
+
+int bus_property_set_log_level(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *value,
+ void *userdata,
+ sd_bus_error *error) {
+
+ const char *t;
+ int r;
+
+ assert(bus);
+ assert(value);
+
+ r = sd_bus_message_read(value, "s", &t);
+ if (r < 0)
+ return r;
+
+ r = log_level_from_string(t);
+ if (r < 0)
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid log level '%s'", t);
+
+ log_info("Setting log level to %s.", t);
+ log_set_max_level(r);
+
+ return 0;
+}
+
+BUS_DEFINE_PROPERTY_GET_GLOBAL(bus_property_get_log_target, "s", log_target_to_string(log_get_target()));
+
+int bus_property_set_log_target(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *value,
+ void *userdata,
+ sd_bus_error *error) {
+
+ LogTarget target;
+ const char *t;
+ int r;
+
+ assert(bus);
+ assert(value);
+
+ r = sd_bus_message_read(value, "s", &t);
+ if (r < 0)
+ return r;
+
+ target = log_target_from_string(t);
+ if (target < 0)
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid log target '%s'", t);
+
+ log_info("Setting log target to %s.", log_target_to_string(target));
+ log_set_target(target);
+ log_open();
+
+ return 0;
+}
+
+BUS_DEFINE_PROPERTY_GET_GLOBAL(bus_property_get_syslog_identifier, "s", program_invocation_short_name);
+
+static const sd_bus_vtable log_control_vtable[] = {
+ SD_BUS_VTABLE_START(0),
+
+ SD_BUS_WRITABLE_PROPERTY("LogLevel", "s", bus_property_get_log_level, bus_property_set_log_level, 0, 0),
+ SD_BUS_WRITABLE_PROPERTY("LogTarget", "s", bus_property_get_log_target, bus_property_set_log_target, 0, 0),
+ SD_BUS_PROPERTY("SyslogIdentifier", "s", bus_property_get_syslog_identifier, 0, 0),
+
+ /* One of those days we might want to add a similar, second interface to cover common service
+ * operations such as Reload(), Reexecute(), Exit() … and maybe some properties exposing version
+ * number and other meta-data of the service. */
+
+ SD_BUS_VTABLE_END,
+};
+
+int bus_log_control_api_register(sd_bus *bus) {
+ int r;
+
+ r = sd_bus_add_object_vtable(
+ bus,
+ NULL,
+ "/org/freedesktop/LogControl1",
+ "org.freedesktop.LogControl1",
+ log_control_vtable, NULL);
+ if (r < 0)
+ return log_error_errno(r, "Failed to register service API object: %m");
+
+ return 0;
+}
diff --git a/src/shared/bus-log-control-api.h b/src/shared/bus-log-control-api.h
new file mode 100644
index 0000000000..a6fb2757c5
--- /dev/null
+++ b/src/shared/bus-log-control-api.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+
+#include "sd-bus.h"
+
+int bus_log_control_api_register(sd_bus *bus);
+
+int bus_property_get_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
+int bus_property_set_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *value, void *userdata, sd_bus_error *error);
+
+int bus_property_get_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
+int bus_property_set_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
+
+int bus_property_get_syslog_identifier(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
diff --git a/src/shared/meson.build b/src/shared/meson.build
index d1832a1f53..483148492c 100644
--- a/src/shared/meson.build
+++ b/src/shared/meson.build
@@ -23,14 +23,16 @@ shared_sources = files('''
bpf-program.h
bridge-util.c
bridge-util.h
+ bus-log-control-api.c
+ bus-log-control-api.h
+ bus-polkit.c
+ bus-polkit.h
bus-unit-procs.c
bus-unit-procs.h
bus-unit-util.c
bus-unit-util.h
bus-util.c
bus-util.h
- bus-polkit.c
- bus-polkit.h
bus-wait-for-jobs.c
bus-wait-for-jobs.h
bus-wait-for-units.c
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index bc49da910e..8e15cd4f06 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -12,6 +12,7 @@
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
+#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "clock-util.h"
#include "conf-files.h"
@@ -1100,6 +1101,10 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
if (r < 0)
return log_error_errno(r, "Failed to register object: %m");
+ r = bus_log_control_api_register(bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(bus, NULL, "org.freedesktop.timedate1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");
diff --git a/src/timesync/timesyncd-bus.c b/src/timesync/timesyncd-bus.c
index 5a5896f0b7..006800709d 100644
--- a/src/timesync/timesyncd-bus.c
+++ b/src/timesync/timesyncd-bus.c
@@ -4,6 +4,7 @@
#include "alloc-util.h"
#include "bus-internal.h"
+#include "bus-log-control-api.h"
#include "bus-protocol.h"
#include "bus-util.h"
#include "in-addr-util.h"
@@ -189,6 +190,10 @@ int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add manager object vtable: %m");
+ r = bus_log_control_api_register(m->bus);
+ if (r < 0)
+ return r;
+
r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.timesync1", 0, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to request name: %m");