Merge pull request #34353 from yuwata/timesync-bus-document

timesync: add document for org.freedesktop.timesync1
This commit is contained in:
Lennart Poettering
2024-09-11 10:15:30 +02:00
committed by GitHub
6 changed files with 190 additions and 2 deletions
+8 -2
View File
@@ -246,9 +246,9 @@ int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to connect to bus: %m");
r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/timesync1", "org.freedesktop.timesync1.Manager", manager_vtable, m);
r = bus_add_implementation(m->bus, &manager_object, m);
if (r < 0)
return log_error_errno(r, "Failed to add manager object vtable: %m");
return r;
r = bus_log_control_api_register(m->bus);
if (r < 0)
@@ -264,3 +264,9 @@ int manager_connect_bus(Manager *m) {
return 0;
}
const BusObjectImplementation manager_object = {
"/org/freedesktop/timesync1",
"org.freedesktop.timesync1.Manager",
.vtables = BUS_VTABLES(manager_vtable),
};
+3
View File
@@ -1,6 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "bus-object.h"
#include "timesyncd-manager.h"
extern const BusObjectImplementation manager_object;
int manager_connect_bus(Manager *m);
+9
View File
@@ -7,6 +7,7 @@
#include "sd-event.h"
#include "sd-messages.h"
#include "bus-log-control-api.h"
#include "capability-util.h"
#include "clock-util.h"
#include "daemon-util.h"
@@ -16,6 +17,7 @@
#include "mkdir-label.h"
#include "network-util.h"
#include "process-util.h"
#include "service-util.h"
#include "signal-util.h"
#include "timesyncd-bus.h"
#include "timesyncd-conf.h"
@@ -144,6 +146,13 @@ static int run(int argc, char *argv[]) {
log_set_facility(LOG_CRON);
log_setup();
r = service_parse_argv("systemd-timesyncd.service",
"Network time synchronization",
BUS_IMPLEMENTATIONS(&manager_object, &log_control_object),
argc, argv);
if (r <= 0)
return r;
umask(0022);
if (argc != 1)