timesync: add support of basic command line options
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 10 Sep 2024 19:05:31 +0000 (04:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 10 Sep 2024 19:08:06 +0000 (04:08 +0900)
src/timesync/timesyncd.c

index a1b63038c45491903cc86dc9aae4d3564cbed1c8..69c6b8e72ac02d404a8d9696e9da422d05059814 100644 (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)