[systemd-commits] 2 commits - .gitignore Makefile.am src/bus-proxyd src/dbus1-generator src/getty-generator units/.gitignore units/systemd-bus-proxyd.socket units/systemd-bus-proxyd at .service.in units/user

Lennart Poettering lennart at kemper.freedesktop.org
Fri Dec 13 11:53:25 PST 2013


 .gitignore                            |   70 ++++++++++++------------
 Makefile.am                           |   16 +++++
 src/bus-proxyd/bus-proxyd.c           |   14 ++--
 src/dbus1-generator/dbus1-generator.c |   33 +++++++++--
 src/getty-generator/getty-generator.c |    2 
 units/.gitignore                      |   99 +++++++++++++++++-----------------
 units/systemd-bus-proxyd.socket       |   12 ++++
 units/systemd-bus-proxyd at .service.in  |   12 ++++
 units/user/systemd-bus-proxyd.socket  |   12 ++++
 9 files changed, 173 insertions(+), 97 deletions(-)

New commits:
commit 7c9a6f906308a6474f1ebb98058c4a33a02c33f1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Dec 13 20:29:35 2013 +0100

    bus: install systemd-bus-proxyd unit files for compatibility with dbus1

diff --git a/.gitignore b/.gitignore
index 7dff099..ab4db60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,22 @@
+*.a
+*.cache
+*.html
+*.la
+*.lo
+*.log
+*.o
+*.plist
+*.pyc
+*.stamp
+*.trs
+*~
+.deps/
+.dirstamp
+.libs/
+/*.tar.bz2
+/*.tar.gz
+/*.tar.xz
 /Makefile
-/defined
-/undefined
-/exported
-/exported-*
 /TAGS
 /accelerometer
 /ata_id
@@ -12,6 +26,9 @@
 /cdrom_id
 /collect
 /coverage/
+/defined
+/exported
+/exported-*
 /gtk-doc.make
 /hostnamectl
 /install-tree
@@ -25,13 +42,14 @@
 /systemadm
 /systemctl
 /systemd
-/systemd-activate
 /systemd-ac-power
+/systemd-activate
 /systemd-analyze
 /systemd-ask-password
 /systemd-backlight
 /systemd-binfmt
 /systemd-bootchart
+/systemd-bus-proxyd
 /systemd-cat
 /systemd-cgls
 /systemd-cgroups-agent
@@ -73,11 +91,10 @@
 /systemd-reply-password
 /systemd-rfkill
 /systemd-run
-/systemd-socket-proxyd
 /systemd-shutdown
 /systemd-shutdownd
 /systemd-sleep
-/systemd-bus-proxyd
+/systemd-socket-proxyd
 /systemd-sysctl
 /systemd-system-update-generator
 /systemd-timedated
@@ -93,18 +110,18 @@
 /test-bus-chat
 /test-bus-creds
 /test-bus-error
+/test-bus-gvariant
 /test-bus-introspect
 /test-bus-kernel
-/test-bus-kernel-bloom
 /test-bus-kernel-benchmark
+/test-bus-kernel-bloom
 /test-bus-marshal
 /test-bus-match
 /test-bus-memfd
 /test-bus-objects
-/test-bus-signature
 /test-bus-server
+/test-bus-signature
 /test-bus-zero-copy
-/test-bus-gvariant
 /test-calendarspec
 /test-catalog
 /test-cgroup
@@ -129,19 +146,23 @@
 /test-journal
 /test-journal-enum
 /test-journal-flush
+/test-journal-init
 /test-journal-interleaving
 /test-journal-match
 /test-journal-send
 /test-journal-stream
-/test-journal-init
 /test-journal-syslog
 /test-journal-verify
+/test-libsystemd-*-sym*
 /test-libudev
+/test-libudev-sym*
 /test-list
 /test-log
 /test-login
 /test-login-shared
+/test-login-tables
 /test-loopback
+/test-machine-tables
 /test-mmap-cache
 /test-namespace
 /test-network
@@ -152,13 +173,11 @@
 /test-rtnl
 /test-sched-prio
 /test-sleep
-/test-strip-tab-ansi
 /test-strbuf
+/test-strip-tab-ansi
 /test-strv
 /test-strxcpyx
 /test-tables
-/test-login-tables
-/test-machine-tables
 /test-time
 /test-udev
 /test-unit-file
@@ -166,31 +185,12 @@
 /test-utf8
 /test-util
 /test-watchdog
-/test-libsystemd-*-sym*
-/test-libudev-sym*
 /timedatectl
 /udevadm
+/undefined
 /v4l_id
-/*.tar.bz2
-/*.tar.gz
-/*.tar.xz
-*.trs
-*.log
-*.a
-*.cache
-*.html
-*.la
-*.lo
-*.o
-*.plist
-*.stamp
-*.pyc
-__pycache__/
-*~
-.deps/
-.dirstamp
-.libs/
 Makefile.in
+__pycache__/
 aclocal.m4
 config.h
 config.h.in
diff --git a/Makefile.am b/Makefile.am
index 0777d01..ca4c5f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1898,6 +1898,22 @@ bus-proxyd-uninstall-hook:
 
 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
+
+nodist_systemunit_DATA += \
+	units/systemd-bus-proxyd at .service
+
+dist_systemunit_DATA += \
+	units/systemd-bus-proxyd.socket
+
+dist_userunit_DATA += \
+	units/user/systemd-bus-proxyd.socket
+
+USER_UNIT_ALIASES += \
+	$(systemunitdir)/systemd-bus-proxyd at .service systemd-bus-proxyd at .service
+
+EXTRA_DIST += \
+	units/systemd-bus-proxyd at .service.in
+
 # ------------------------------------------------------------------------------
 systemd_tty_ask_password_agent_SOURCES = \
 	src/tty-ask-password-agent/tty-ask-password-agent.c
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index f391fbf..015f40a 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 dd299ed..e86fc6e 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;
 }
diff --git a/units/.gitignore b/units/.gitignore
index c5ac8fe..94876ed 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -1,66 +1,67 @@
-/systemd-backlight at .service
-/systemd-rfkill at .service
-/halt-local.service
-/rc-local.service
-/systemd-hybrid-sleep.service
-/systemd-journal-gatewayd.service
-/systemd-journal-flush.service
-/systemd-hibernate.service
-/systemd-suspend.service
 /console-getty.service
 /console-getty.service.m4
-/container-getty at .service
-/container-getty at .service.m4
-/systemd-journald.service
-/user at .service
-/systemd-logind.service
-/systemd-localed.service
-/systemd-timedated.service
-/systemd-hostnamed.service
 /console-shell.service
 /console-shell.service.m4
-/systemd-sysctl.service
-/systemd-ask-password-console.service
+/container-getty at .service
+/container-getty at .service.m4
+/debug-shell.service
+/emergency.service
+/getty at .service
+/halt-local.service
+/initrd-cleanup.service
+/initrd-parse-etc.service
+/initrd-switch-root.service
+/initrd-udevadm-cleanup-db.service
+/kmod-static-nodes.service
+/quotaon.service
+/rc-local.service
 /rescue.service
 /rescue.service.m4
+/serial-getty at .service
+/systemd-ask-password-console.service
 /systemd-ask-password-wall.service
-/systemd-quotacheck.service
-/quotaon.service
-/systemd-fsck at .service
+/systemd-backlight at .service
+/systemd-binfmt.service
+/systemd-bus-proxyd at .service
 /systemd-fsck-root.service
-/systemd-tmpfiles-clean.service
-/systemd-tmpfiles-setup.service
-/systemd-tmpfiles-setup-dev.service
+/systemd-fsck at .service
 /systemd-halt.service
-/systemd-poweroff.service
-/systemd-reboot.service
+/systemd-hibernate.service
+/systemd-hostnamed.service
+/systemd-hybrid-sleep.service
+/systemd-initctl.service
+/systemd-journal-flush.service
+/systemd-journal-gatewayd.service
+/systemd-journald.service
 /systemd-kexec.service
-/systemd-user-sessions.service
-/systemd-readahead-done.service
-/systemd-tmpfiles.service
+/systemd-localed.service
+/systemd-logind.service
+/systemd-machined.service
+/systemd-modules-load.service
+/systemd-networkd.service
+/systemd-nspawn at .service
+/systemd-poweroff.service
+/systemd-quotacheck.service
+/systemd-random-seed.service
 /systemd-readahead-collect.service
+/systemd-readahead-done.service
 /systemd-readahead-replay.service
-/serial-getty at .service
-/systemd-modules-load.service
+/systemd-reboot.service
 /systemd-remount-fs.service
-/systemd-vconsole-setup.service
+/systemd-rfkill at .service
 /systemd-shutdownd.service
-/systemd-random-seed.service
-/systemd-initctl.service
-/getty at .service
-/systemd-update-utmp.service
-/systemd-update-utmp-runlevel.service
-/systemd-binfmt.service
-/emergency.service
+/systemd-suspend.service
+/systemd-sysctl.service
+/systemd-timedated.service
+/systemd-tmpfiles-clean.service
+/systemd-tmpfiles-setup-dev.service
+/systemd-tmpfiles-setup.service
+/systemd-tmpfiles.service
 /systemd-udev-settle.service
 /systemd-udev-trigger.service
 /systemd-udevd.service
-/debug-shell.service
-/initrd-cleanup.service
-/initrd-parse-etc.service
-/initrd-switch-root.service
-/initrd-udevadm-cleanup-db.service
-/systemd-networkd.service
-/systemd-nspawn at .service
-/systemd-machined.service
-/kmod-static-nodes.service
+/systemd-update-utmp-runlevel.service
+/systemd-update-utmp.service
+/systemd-user-sessions.service
+/systemd-vconsole-setup.service
+/user at .service
diff --git a/units/systemd-bus-proxyd.socket b/units/systemd-bus-proxyd.socket
new file mode 100644
index 0000000..e955dce
--- /dev/null
+++ b/units/systemd-bus-proxyd.socket
@@ -0,0 +1,12 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Legacy D-Bus Protocol Compatibility Socket
+
+[Socket]
+ListenStream=/run/dbus/system_bus_socket
diff --git a/units/systemd-bus-proxyd at .service.in b/units/systemd-bus-proxyd at .service.in
new file mode 100644
index 0000000..93d6563
--- /dev/null
+++ b/units/systemd-bus-proxyd at .service.in
@@ -0,0 +1,12 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Description]
+Description=Legacy D-Bus Protocol Compatibility Daemon
+
+[Service]
+ExecStart=@rootlibexecdir@/systemd-bus-proxyd
diff --git a/units/user/systemd-bus-proxyd.socket b/units/user/systemd-bus-proxyd.socket
new file mode 100644
index 0000000..1971063
--- /dev/null
+++ b/units/user/systemd-bus-proxyd.socket
@@ -0,0 +1,12 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Legacy D-Bus Protocol Compatibility Socket
+
+[Socket]
+ListenStream=%r/bus

commit 207d1d0922d4e668cc6fac98be39e5a8b83ebc8a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Dec 13 20:36:02 2013 +0100

    getty-generator: fix segfault when $container_ttys is not set

diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c
index 36a9369..feb5815 100644
--- a/src/getty-generator/getty-generator.c
+++ b/src/getty-generator/getty-generator.c
@@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
                  * the variable name we only support ptys here. */
 
                 r = getenv_for_pid(1, "container_ttys", &container_ttys);
-                if (r >= 0) {
+                if (r > 0) {
                         char *w, *state;
                         size_t l;
 



More information about the systemd-commits mailing list