summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bus-proxyd/bus-proxyd.c14
-rw-r--r--src/dbus1-generator/dbus1-generator.c33
2 files changed, 35 insertions, 12 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index f391fbf42b..015f40a65c 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -40,18 +40,20 @@
#include "bus-util.h"
#include "build.h"
-#define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket"
-
-const char *arg_bus_path = DEFAULT_BUS_PATH;
+#ifdef ENABLE_KDBUS
+const char *arg_bus_path = "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket";
+#else
+const char *arg_bus_path = "unix:path=/run/dbus/system_bus_socket";
+#endif
static int help(void) {
printf("%s [OPTIONS...]\n\n"
- "STDIO or socket-activatable proxy to a given DBus endpoint.\n\n"
+ "Connection STDIO or a socket to a given bus address.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
- " -p --bus-path=PATH Path to the kernel bus (default: %s)\n",
- program_invocation_short_name, DEFAULT_BUS_PATH);
+ " -p --bus-path=PATH Bus address to forward to (default: %s)\n",
+ program_invocation_short_name, arg_bus_path);
return 0;
}
diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c
index dd299edc75..e86fc6e56a 100644
--- a/src/dbus1-generator/dbus1-generator.c
+++ b/src/dbus1-generator/dbus1-generator.c
@@ -28,7 +28,7 @@
#include "unit-name.h"
#include "cgroup-util.h"
-static const char *arg_dest = "/tmp";
+static const char *arg_dest_late = "/tmp", *arg_dest = "/tmp";
static int create_dbus_files(
const char *path,
@@ -52,7 +52,7 @@ static int create_dbus_files(
if (!s)
return log_oom();
- a = strjoin(arg_dest, "/", s, NULL);
+ a = strjoin(arg_dest_late, "/", s, NULL);
if (!a)
return log_oom();
@@ -98,7 +98,7 @@ static int create_dbus_files(
service = s;
}
- b = strjoin(arg_dest, "/", name, ".busname", NULL);
+ b = strjoin(arg_dest_late, "/", name, ".busname", NULL);
if (!b)
return log_oom();
@@ -127,7 +127,7 @@ static int create_dbus_files(
return -errno;
}
- lnk = strjoin(arg_dest, "/" SPECIAL_BUSNAMES_TARGET ".wants/", name, ".busname", NULL);
+ lnk = strjoin(arg_dest_late, "/" SPECIAL_BUSNAMES_TARGET ".wants/", name, ".busname", NULL);
if (!lnk)
return log_oom();
@@ -264,6 +264,21 @@ static int link_busnames_target(const char *units) {
return 0;
}
+static int link_compatibility(const char *units) {
+ const char *f, *t;
+
+ f = strappenda(units, "/systemd-socket-proxy.socket");
+ t = strappenda(arg_dest, "/" SPECIAL_DBUS_SOCKET);
+
+ mkdir_parents_label(t, 0755);
+ if (symlink(f, t) < 0) {
+ log_error("Failed to create symlink %s: %m", t);
+ return -errno;
+ }
+
+ return 0;
+}
+
int main(int argc, char *argv[]) {
const char *path, *type, *units;
int r, q;
@@ -273,8 +288,10 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
- if (argc > 1)
- arg_dest = argv[3];
+ if (argc > 1) {
+ arg_dest = argv[1];
+ arg_dest_late = argv[3];
+ }
log_set_target(LOG_TARGET_SAFE);
log_parse_environment();
@@ -306,5 +323,9 @@ int main(int argc, char *argv[]) {
if (q < 0)
r = q;
+ q = link_compatibility(units);
+ if (q < 0)
+ r = q;
+
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}