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

This commit is contained in:
Lennart Poettering 2013-12-13 20:29:35 +01:00
parent 207d1d0922
commit 7c9a6f9063
8 changed files with 178 additions and 102 deletions

70
.gitignore vendored
View file

@ -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 /Makefile
/defined
/undefined
/exported
/exported-*
/TAGS /TAGS
/accelerometer /accelerometer
/ata_id /ata_id
@ -12,6 +26,9 @@
/cdrom_id /cdrom_id
/collect /collect
/coverage/ /coverage/
/defined
/exported
/exported-*
/gtk-doc.make /gtk-doc.make
/hostnamectl /hostnamectl
/install-tree /install-tree
@ -25,13 +42,14 @@
/systemadm /systemadm
/systemctl /systemctl
/systemd /systemd
/systemd-activate
/systemd-ac-power /systemd-ac-power
/systemd-activate
/systemd-analyze /systemd-analyze
/systemd-ask-password /systemd-ask-password
/systemd-backlight /systemd-backlight
/systemd-binfmt /systemd-binfmt
/systemd-bootchart /systemd-bootchart
/systemd-bus-proxyd
/systemd-cat /systemd-cat
/systemd-cgls /systemd-cgls
/systemd-cgroups-agent /systemd-cgroups-agent
@ -73,11 +91,10 @@
/systemd-reply-password /systemd-reply-password
/systemd-rfkill /systemd-rfkill
/systemd-run /systemd-run
/systemd-socket-proxyd
/systemd-shutdown /systemd-shutdown
/systemd-shutdownd /systemd-shutdownd
/systemd-sleep /systemd-sleep
/systemd-bus-proxyd /systemd-socket-proxyd
/systemd-sysctl /systemd-sysctl
/systemd-system-update-generator /systemd-system-update-generator
/systemd-timedated /systemd-timedated
@ -93,18 +110,18 @@
/test-bus-chat /test-bus-chat
/test-bus-creds /test-bus-creds
/test-bus-error /test-bus-error
/test-bus-gvariant
/test-bus-introspect /test-bus-introspect
/test-bus-kernel /test-bus-kernel
/test-bus-kernel-bloom
/test-bus-kernel-benchmark /test-bus-kernel-benchmark
/test-bus-kernel-bloom
/test-bus-marshal /test-bus-marshal
/test-bus-match /test-bus-match
/test-bus-memfd /test-bus-memfd
/test-bus-objects /test-bus-objects
/test-bus-signature
/test-bus-server /test-bus-server
/test-bus-signature
/test-bus-zero-copy /test-bus-zero-copy
/test-bus-gvariant
/test-calendarspec /test-calendarspec
/test-catalog /test-catalog
/test-cgroup /test-cgroup
@ -129,19 +146,23 @@
/test-journal /test-journal
/test-journal-enum /test-journal-enum
/test-journal-flush /test-journal-flush
/test-journal-init
/test-journal-interleaving /test-journal-interleaving
/test-journal-match /test-journal-match
/test-journal-send /test-journal-send
/test-journal-stream /test-journal-stream
/test-journal-init
/test-journal-syslog /test-journal-syslog
/test-journal-verify /test-journal-verify
/test-libsystemd-*-sym*
/test-libudev /test-libudev
/test-libudev-sym*
/test-list /test-list
/test-log /test-log
/test-login /test-login
/test-login-shared /test-login-shared
/test-login-tables
/test-loopback /test-loopback
/test-machine-tables
/test-mmap-cache /test-mmap-cache
/test-namespace /test-namespace
/test-network /test-network
@ -152,13 +173,11 @@
/test-rtnl /test-rtnl
/test-sched-prio /test-sched-prio
/test-sleep /test-sleep
/test-strip-tab-ansi
/test-strbuf /test-strbuf
/test-strip-tab-ansi
/test-strv /test-strv
/test-strxcpyx /test-strxcpyx
/test-tables /test-tables
/test-login-tables
/test-machine-tables
/test-time /test-time
/test-udev /test-udev
/test-unit-file /test-unit-file
@ -166,31 +185,12 @@
/test-utf8 /test-utf8
/test-util /test-util
/test-watchdog /test-watchdog
/test-libsystemd-*-sym*
/test-libudev-sym*
/timedatectl /timedatectl
/udevadm /udevadm
/undefined
/v4l_id /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 Makefile.in
__pycache__/
aclocal.m4 aclocal.m4
config.h config.h
config.h.in config.h.in

View file

@ -1898,6 +1898,22 @@ bus-proxyd-uninstall-hook:
INSTALL_EXEC_HOOKS += bus-proxyd-install-hook INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
nodist_systemunit_DATA += \
units/systemd-bus-proxyd@.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@.service systemd-bus-proxyd@.service
EXTRA_DIST += \
units/systemd-bus-proxyd@.service.in
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
systemd_tty_ask_password_agent_SOURCES = \ systemd_tty_ask_password_agent_SOURCES = \
src/tty-ask-password-agent/tty-ask-password-agent.c src/tty-ask-password-agent/tty-ask-password-agent.c

View file

@ -40,18 +40,20 @@
#include "bus-util.h" #include "bus-util.h"
#include "build.h" #include "build.h"
#define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket" #ifdef ENABLE_KDBUS
const char *arg_bus_path = "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket";
const char *arg_bus_path = DEFAULT_BUS_PATH; #else
const char *arg_bus_path = "unix:path=/run/dbus/system_bus_socket";
#endif
static int help(void) { static int help(void) {
printf("%s [OPTIONS...]\n\n" 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" " -h --help Show this help\n"
" --version Show package version\n" " --version Show package version\n"
" -p --bus-path=PATH Path to the kernel bus (default: %s)\n", " -p --bus-path=PATH Bus address to forward to (default: %s)\n",
program_invocation_short_name, DEFAULT_BUS_PATH); program_invocation_short_name, arg_bus_path);
return 0; return 0;
} }

View file

@ -28,7 +28,7 @@
#include "unit-name.h" #include "unit-name.h"
#include "cgroup-util.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( static int create_dbus_files(
const char *path, const char *path,
@ -52,7 +52,7 @@ static int create_dbus_files(
if (!s) if (!s)
return log_oom(); return log_oom();
a = strjoin(arg_dest, "/", s, NULL); a = strjoin(arg_dest_late, "/", s, NULL);
if (!a) if (!a)
return log_oom(); return log_oom();
@ -98,7 +98,7 @@ static int create_dbus_files(
service = s; service = s;
} }
b = strjoin(arg_dest, "/", name, ".busname", NULL); b = strjoin(arg_dest_late, "/", name, ".busname", NULL);
if (!b) if (!b)
return log_oom(); return log_oom();
@ -127,7 +127,7 @@ static int create_dbus_files(
return -errno; 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) if (!lnk)
return log_oom(); return log_oom();
@ -264,6 +264,21 @@ static int link_busnames_target(const char *units) {
return 0; 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[]) { int main(int argc, char *argv[]) {
const char *path, *type, *units; const char *path, *type, *units;
int r, q; int r, q;
@ -273,8 +288,10 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (argc > 1) if (argc > 1) {
arg_dest = argv[3]; arg_dest = argv[1];
arg_dest_late = argv[3];
}
log_set_target(LOG_TARGET_SAFE); log_set_target(LOG_TARGET_SAFE);
log_parse_environment(); log_parse_environment();
@ -306,5 +323,9 @@ int main(int argc, char *argv[]) {
if (q < 0) if (q < 0)
r = q; r = q;
q = link_compatibility(units);
if (q < 0)
r = q;
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
} }

111
units/.gitignore vendored
View file

@ -1,66 +1,67 @@
/systemd-backlight@.service
/systemd-rfkill@.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
/console-getty.service.m4 /console-getty.service.m4
/container-getty@.service
/container-getty@.service.m4
/systemd-journald.service
/user@.service
/systemd-logind.service
/systemd-localed.service
/systemd-timedated.service
/systemd-hostnamed.service
/console-shell.service /console-shell.service
/console-shell.service.m4 /console-shell.service.m4
/systemd-sysctl.service /container-getty@.service
/systemd-ask-password-console.service /container-getty@.service.m4
/rescue.service
/rescue.service.m4
/systemd-ask-password-wall.service
/systemd-quotacheck.service
/quotaon.service
/systemd-fsck@.service
/systemd-fsck-root.service
/systemd-tmpfiles-clean.service
/systemd-tmpfiles-setup.service
/systemd-tmpfiles-setup-dev.service
/systemd-halt.service
/systemd-poweroff.service
/systemd-reboot.service
/systemd-kexec.service
/systemd-user-sessions.service
/systemd-readahead-done.service
/systemd-tmpfiles.service
/systemd-readahead-collect.service
/systemd-readahead-replay.service
/serial-getty@.service
/systemd-modules-load.service
/systemd-remount-fs.service
/systemd-vconsole-setup.service
/systemd-shutdownd.service
/systemd-random-seed.service
/systemd-initctl.service
/getty@.service
/systemd-update-utmp.service
/systemd-update-utmp-runlevel.service
/systemd-binfmt.service
/emergency.service
/systemd-udev-settle.service
/systemd-udev-trigger.service
/systemd-udevd.service
/debug-shell.service /debug-shell.service
/emergency.service
/getty@.service
/halt-local.service
/initrd-cleanup.service /initrd-cleanup.service
/initrd-parse-etc.service /initrd-parse-etc.service
/initrd-switch-root.service /initrd-switch-root.service
/initrd-udevadm-cleanup-db.service /initrd-udevadm-cleanup-db.service
/kmod-static-nodes.service
/quotaon.service
/rc-local.service
/rescue.service
/rescue.service.m4
/serial-getty@.service
/systemd-ask-password-console.service
/systemd-ask-password-wall.service
/systemd-backlight@.service
/systemd-binfmt.service
/systemd-bus-proxyd@.service
/systemd-fsck-root.service
/systemd-fsck@.service
/systemd-halt.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-localed.service
/systemd-logind.service
/systemd-machined.service
/systemd-modules-load.service
/systemd-networkd.service /systemd-networkd.service
/systemd-nspawn@.service /systemd-nspawn@.service
/systemd-machined.service /systemd-poweroff.service
/kmod-static-nodes.service /systemd-quotacheck.service
/systemd-random-seed.service
/systemd-readahead-collect.service
/systemd-readahead-done.service
/systemd-readahead-replay.service
/systemd-reboot.service
/systemd-remount-fs.service
/systemd-rfkill@.service
/systemd-shutdownd.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
/systemd-update-utmp-runlevel.service
/systemd-update-utmp.service
/systemd-user-sessions.service
/systemd-vconsole-setup.service
/user@.service

View file

@ -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

View file

@ -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

View file

@ -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