Skip to content

Commit

Permalink
core: convert PID 1 to libsystemd-bus
Browse files Browse the repository at this point in the history
This patch converts PID 1 to libsystemd-bus and thus drops the
dependency on libdbus. The only remaining code using libdbus is a test
case that validates our bus marshalling against libdbus' marshalling,
and this dependency can be turned off.

This patch also adds a couple of things to libsystem-bus, that are
necessary to make the port work:

- Synthesizing of "Disconnected" messages when bus connections are
  severed.

- Support for attaching multiple vtables for the same interface on the
  same path.

This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus
calls which used an inappropriate signature.

As a side effect we will now generate PropertiesChanged messages which
carry property contents, rather than just invalidation information.
  • Loading branch information
poettering committed Nov 20, 2013
1 parent 3febea3 commit 718db96
Show file tree
Hide file tree
Showing 106 changed files with 6,153 additions and 9,243 deletions.
71 changes: 10 additions & 61 deletions Makefile.am
Expand Up @@ -662,16 +662,19 @@ libsystemd_shared_la_SOURCES = \
src/shared/linux/fanotify.h \
src/shared/linux/seccomp.h \
src/shared/linux/seccomp-bpf.h \
src/shared/ioprio.h \
src/shared/missing.h \
src/shared/list.h \
src/shared/macro.h \
src/shared/def.h \
src/shared/sparse-endian.h \
src/shared/refcnt.h \
src/shared/udev-util.h \
src/shared/bus-errors.h \
src/shared/device-nodes.c \
src/shared/device-nodes.h \
src/shared/sparse-endian.h \
src/shared/util.c \
src/shared/util.h \
src/shared/udev-util.h \
src/shared/virt.c \
src/shared/virt.h \
src/shared/efivars.c \
Expand Down Expand Up @@ -712,7 +715,6 @@ libsystemd_shared_la_SOURCES = \
src/shared/gunicode.h \
src/shared/pager.c \
src/shared/pager.h \
src/shared/ioprio.h \
src/shared/socket-util.c \
src/shared/socket-util.h \
src/shared/conf-files.c \
Expand Down Expand Up @@ -748,7 +750,6 @@ libsystemd_shared_la_SOURCES = \
src/shared/acpi-fpdt.c \
src/shared/boot-timestamps.h \
src/shared/boot-timestamps.c \
src/shared/refcnt.h \
src/shared/mkdir.c \
src/shared/mkdir.h \
src/shared/smack-util.c \
Expand All @@ -762,21 +763,6 @@ libsystemd_shared_la_SOURCES = \
src/shared/net-util.c \
src/shared/net-util.h

#-------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-dbus.la

libsystemd_dbus_la_SOURCES = \
src/shared/dbus-common.c \
src/shared/dbus-common.h

libsystemd_dbus_la_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

libsystemd_dbus_la_LIBADD = \
$(DBUS_LIBS)

# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-units.la
Expand All @@ -792,8 +778,7 @@ libsystemd_units_la_SOURCES = \
src/shared/specifier.h

libsystemd_units_la_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)
$(AM_CFLAGS)

# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
Expand Down Expand Up @@ -953,6 +938,8 @@ libsystemd_core_la_SOURCES = \
src/core/dbus-kill.h \
src/core/dbus-cgroup.c \
src/core/dbus-cgroup.h \
src/core/dbus-client-track.c \
src/core/dbus-client-track.h \
src/core/cgroup.c \
src/core/cgroup.h \
src/core/selinux-access.c \
Expand Down Expand Up @@ -982,7 +969,6 @@ libsystemd_core_la_SOURCES = \
src/core/securebits.h \
src/core/initreq.h \
src/core/special.h \
src/core/bus-errors.h \
src/core/build.h \
src/core/sysfs-show.h \
src/core/switch-root.h \
Expand Down Expand Up @@ -1010,7 +996,6 @@ nodist_libsystemd_core_la_SOURCES = \

libsystemd_core_la_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS) \
$(LIBWRAP_CFLAGS) \
$(PAM_CFLAGS) \
$(AUDIT_CFLAGS) \
Expand All @@ -1021,13 +1006,13 @@ libsystemd_core_la_LIBADD = \
libsystemd-capability.la \
libsystemd-units.la \
libsystemd-label.la \
libsystemd-dbus.la \
libsystemd-audit.la \
libsystemd-id128-internal.la \
libsystemd-daemon-internal.la \
libudev-internal.la \
libsystemd-shared.la \
libsystemd-rtnl.la \
libsystemd-bus-internal.la \
$(LIBWRAP_LIBS) \
$(PAM_LIBS) \
$(AUDIT_LIBS) \
Expand Down Expand Up @@ -1072,10 +1057,6 @@ src/core/syscall-to-name.h: src/core/syscall-list.txt Makefile
systemd_SOURCES = \
src/core/main.c

systemd_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

systemd_LDADD = \
libsystemd-core.la \
$(RT_LIBS)
Expand Down Expand Up @@ -1166,21 +1147,13 @@ test_device_nodes_LDADD = \
test_engine_SOURCES = \
src/test/test-engine.c

test_engine_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_engine_LDADD = \
libsystemd-core.la \
$(RT_LIBS)

test_job_type_SOURCES = \
src/test/test-job-type.c

test_job_type_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_job_type_LDADD = \
libsystemd-core.la \
$(RT_LIBS)
Expand All @@ -1191,10 +1164,6 @@ test_ns_SOURCES = \
test_ns_LDADD = \
libsystemd-core.la

test_ns_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_loopback_SOURCES = \
src/test/test-loopback.c

Expand All @@ -1221,21 +1190,13 @@ endif
test_unit_name_SOURCES = \
src/test/test-unit-name.c

test_unit_name_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_unit_name_LDADD = \
libsystemd-core.la \
$(RT_LIBS)

test_unit_file_SOURCES = \
src/test/test-unit-file.c

test_unit_file_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_unit_file_LDADD = \
libsystemd-core.la \
$(RT_LIBS)
Expand Down Expand Up @@ -1274,10 +1235,6 @@ test_tables_SOURCES = \
src/test/test-tables.c \
src/shared/test-tables.h

test_tables_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_tables_LDADD = \
libsystemd-logs.la \
libsystemd-journal-internal.la \
Expand Down Expand Up @@ -1401,10 +1358,6 @@ test_strxcpyx_LDADD = \
test_install_SOURCES = \
src/test/test-install.c

test_install_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS)

test_install_LDADD = \
libsystemd-units.la \
libsystemd-label.la \
Expand All @@ -1422,7 +1375,6 @@ test_sched_prio_SOURCES = \

test_sched_prio_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS) \
-D"STR(s)=\#s" -D"TEST_DIR=STR($(abs_top_srcdir)/test/)"

test_sched_prio_LDADD = \
Expand Down Expand Up @@ -2800,9 +2752,6 @@ mtd_probe_SOURCES = \
src/udev/mtd_probe/mtd_probe.h \
src/udev/mtd_probe/probe_smartmedia.c

mtd_probe_CPPFLAGS = \
$(AM_CPPFLAGS)

dist_udevrules_DATA += \
rules/75-probe_mtd.rules

Expand Down Expand Up @@ -3893,7 +3842,6 @@ systemd_logind_LDADD = \

libsystemd_logind_core_la_SOURCES = \
src/login/logind-core.c \
src/login/logind-dbus.c \
src/login/logind-device.c \
src/login/logind-device.h \
src/login/logind-button.c \
Expand All @@ -3910,6 +3858,7 @@ libsystemd_logind_core_la_SOURCES = \
src/login/logind-user.h \
src/login/logind-inhibit.c \
src/login/logind-inhibit.h \
src/login/logind-dbus.c \
src/login/logind-session-dbus.c \
src/login/logind-seat-dbus.c \
src/login/logind-user-dbus.c \
Expand Down
47 changes: 47 additions & 0 deletions TODO
Expand Up @@ -43,6 +43,53 @@ CGroup Rework Completion:

Features:

* sd-event: allow multiple signal handlers per signal

* timer: expose accuracy as unit setting

* sd-event: do per-minute coalescing of timer events too

* when we detect low battery and no AC on boot, show pretty splash and refuse boot

* move libasyncns into systemd as libsystemd-asyncns

* calendarspec: support value ranges with ".." notation. Example: 2013-4..8-1

* pid1 porting:
- restore selinux access control on properties

* sd-bus: when triggering property change events, allow a NULL strv indicate that all properties listed as such are send out as changed

* sd-bus: enforce signatures on response messages

* sd-bus: make message handlers take an sd_bus_error and generate error replies automatically if they are set

* sd-bus: when replying to a bus message we should not need to specify the bus again

* sd-bus: see if we can drop more message validation on the sending side

* sd-bus: introduce sd_bus_creds object and attach it to messages as well as allow querying it for names

* sd-bus: support "const" properties as flag

* sd-bus: add api call to escape bus path components

* sd-event: when a handler returns an error, just turn off its event
source, but do not return anything up to the event loop
caller. Instead add parameter to sd_event_request_quit() to take
retval. This way errors rippling upwards are the option, not the
default

* sd-event: child pid handling: first invoke waitid(WNOHANG) and call event handler, only afterwards reap the process

* sd-event: native support for watchdog stuff

* machined, localed: when we try to kill an empty cgroup, generate an ESRCH call over the bus

* sd-bus: SD_BUS_COMMENT() macro for inclusion in vtables, syntax inspired by gdbus

* libsystemd-journal, libsystemd-login, libudev: add calls to easily attach these objects to sd-event event loops

* be more careful what we export on the bus as (usec_t) 0 and (usec_t) -1

* check :no-sender logic after PID 1 conversion
Expand Down

0 comments on commit 718db96

Please sign in to comment.