]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
importd,logind: add --bus-introspect= option
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Apr 2020 15:55:34 +0000 (17:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 May 2020 20:34:17 +0000 (22:34 +0200)
src/hostname/hostnamed.c
src/import/importd.c
src/locale/localed.c
src/login/logind.c
src/machine/machined.c
src/resolve/resolved.c
src/shared/service-util.c
src/shared/service-util.h
src/timedate/timedated.c

index b2b5299b32535396960371c25b771ad02c3222a9..535c800bebc01c21792e69eb787bd854fe1a3679 100644 (file)
@@ -783,6 +783,7 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-hostnamed.service",
                                "Manage the system hostname and related metadata.",
+                               NULL,
                                argc, argv);
         if (r <= 0)
                 return r;
index 398b2964b0585e6089a24da2aec8690835ccedee..9408edece10ca8b389b4673b846005c78366ff8f 100644 (file)
@@ -1376,6 +1376,8 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-importd.service",
                                "VM and container image import and export service.",
+                               BUS_IMPLEMENTATIONS(&manager_object,
+                                                   &log_control_object),
                                argc, argv);
         if (r <= 0)
                 return r;
index a0fcadcc9148ece3a31484cd57f6b52f5da4d48e..ef73448854e681dca8167ed4654828af0a38365a 100644 (file)
@@ -757,6 +757,7 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-localed.service",
                                "Manage system locale settings and key mappings.",
+                               NULL,
                                argc, argv);
         if (r <= 0)
                 return r;
index 1bf1f21f00293549d87638e5d39927931343b8fa..d748e8f4b81daefca6fea72b2bee078394a046f2 100644 (file)
@@ -1180,6 +1180,8 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-logind.service",
                                "Manager for user logins and devices and privileged operations.",
+                               BUS_IMPLEMENTATIONS(&manager_object,
+                                                   &log_control_object),
                                argc, argv);
         if (r <= 0)
                 return r;
index 191031e2aabeb5a49429cfa26a669de673e687ca..5a24f6ccc8dac70effa31b9e28f29ecea4c3f8cc 100644 (file)
@@ -360,6 +360,7 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-machined.service",
                                "Manage registrations of local VMs and containers.",
+                               NULL,
                                argc, argv);
         if (r <= 0)
                 return r;
index 73da508d7ac6ce9682b679de0119c67c482671c4..6f2b4c114e9e09624c51c31f052cee2002e742c0 100644 (file)
@@ -28,6 +28,7 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-resolved.service",
                                "Provide name resolution with caching using DNS, mDNS, LLMNR.",
+                               NULL,
                                argc, argv);
         if (r <= 0)
                 return r;
index 7fea74d2d95355c19c5e08dabfa38f69635a3a75..c9b684fc05ea440f43fbcfca3b02413ab0f57e9d 100644 (file)
@@ -9,7 +9,7 @@
 #include "terminal-util.h"
 #include "util.h"
 
-static int help(const char *program_path, const char *service, const char *description) {
+static int help(const char *program_path, const char *service, const char *description, bool bus_introspect) {
         _cleanup_free_ char *link = NULL;
         int r;
 
@@ -23,6 +23,7 @@ static int help(const char *program_path, const char *service, const char *descr
                "%sOptions%s:\n"
                "  -h --help                 Show this help\n"
                "     --version              Show package version\n"
+               "     --bus-introspect=PATH  Write D-Bus XML introspection data\n"
                "\nSee the %s for details.\n"
                , program_path
                , ansi_highlight(), description, ansi_normal()
@@ -36,15 +37,18 @@ static int help(const char *program_path, const char *service, const char *descr
 int service_parse_argv(
                 const char *service,
                 const char *description,
+                const BusObjectImplementation* const* bus_objects,
                 int argc, char *argv[]) {
 
         enum {
                 ARG_VERSION = 0x100,
+                ARG_BUS_INTROSPECT,
         };
 
         static const struct option options[] = {
                 { "help",           no_argument,       NULL, 'h'                },
                 { "version",        no_argument,       NULL, ARG_VERSION        },
+                { "bus-introspect", required_argument, NULL, ARG_BUS_INTROSPECT },
                 {}
         };
 
@@ -57,11 +61,17 @@ int service_parse_argv(
                 switch(c) {
 
                 case 'h':
-                        return help(argv[0], service, description);
+                        return help(argv[0], service, description, bus_objects);
 
                 case ARG_VERSION:
                         return version();
 
+                case ARG_BUS_INTROSPECT:
+                        return bus_introspect_implementations(
+                                        stdout,
+                                        optarg,
+                                        bus_objects);
+
                 case '?':
                         return -EINVAL;
 
index f4868184f4899e355af8a242f4ae8c3f8bdc978d..76bff61d58b4a707d6e8daed688f38f981e3bf28 100644 (file)
@@ -1,7 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
+#include "bus-util.h"
+
 int service_parse_argv(
                 const char *service,
                 const char *description,
+                const BusObjectImplementation* const* bus_objects,
                 int argc, char *argv[]);
index 6dac0bafffa11ae8b5e63f67165a25c0de0499ba..7f2e3019d4253144ff4754521a1b363eeb62c61c 100644 (file)
@@ -1129,6 +1129,7 @@ static int run(int argc, char *argv[]) {
 
         r = service_parse_argv("systemd-timedated.service",
                                "Manage the system clock and timezone and NTP enablement.",
+                               NULL,
                                argc, argv);
         if (r <= 0)
                 return r;