Since we want to retain the ability to break kernel ←→ userspace ABI
after the next release, let's not make use by default of kdbus, so that
people with future kernels will not suddenly break with current systemd
versions.
kdbus support is left in all builds but must now be explicitly requested
at runtime (for example via setting $DBUS_SESSION_BUS). Via a configure
switch the old behaviour can be restored. In fact, we change autogen.sh
to do this, so that git builds (which run autogen.sh) get kdbus by
default, but tarball builds (which ue the configure defaults) do not get
it, and hence this stays out of the distros by default.
- support "const" properties as flag
- add API to clone sd_bus_message objects
- SD_BUS_COMMENT() macro for inclusion in vtables, syntax inspired by gdbus
- support "const" properties as flag
- add API to clone sd_bus_message objects
- SD_BUS_COMMENT() macro for inclusion in vtables, syntax inspired by gdbus
- - unelss configure option is specified refuse connecting and creating kdbus, so that we can break compat
+ - make sd_bus_open_system_container() kdbus aware
- longer term:
* priority queues
* priority inheritance
- longer term:
* priority queues
* priority inheritance
fi
if [ "x$1" = "xc" ]; then
fi
if [ "x$1" = "xc" ]; then
- ./configure CFLAGS='-g -O0' $args
+ ./configure CFLAGS='-g -O0' --enable-kdbus $args
make clean
elif [ "x$1" = "xg" ]; then
make clean
elif [ "x$1" = "xg" ]; then
- ./configure CFLAGS='-g -Og' $args
+ ./configure CFLAGS='-g -Og' --enable-kdbus $args
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
- echo "./configure CFLAGS='-g -O0' $args"
+ echo "./configure CFLAGS='-g -O0' --enable-kdbus $args"
fi
AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
fi
AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
+# ------------------------------------------------------------------------------
+have_kdbus=no
+AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do not connect to kdbus by default]))
+if test "x$enable_kdbus" == "xyes"; then
+ AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
+ have_kdbus=yes
+fi
+AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
+
# ------------------------------------------------------------------------------
AC_ARG_WITH(rc-local-script-path-start,
AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
# ------------------------------------------------------------------------------
AC_ARG_WITH(rc-local-script-path-start,
AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
gudev: ${enable_gudev}
gintrospection: ${enable_introspection}
multi-seat-x: ${have_multi_seat_x}
gudev: ${enable_gudev}
gintrospection: ${enable_introspection}
multi-seat-x: ${have_multi_seat_x}
Python: ${have_python}
Python Headers: ${have_python_devel}
man pages: ${have_manpages}
Python: ${have_python}
Python Headers: ${have_python_devel}
man pages: ${have_manpages}
if (m->kdbus_fd >= 0)
return 0;
if (m->kdbus_fd >= 0)
return 0;
}
log_info("Successfully set up kdbus on %s", p);
}
log_info("Successfully set up kdbus on %s", p);
if (e)
r = sd_bus_set_address(b, e);
else
if (e)
r = sd_bus_set_address(b, e);
else
r = sd_bus_set_address(b, "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket");
r = sd_bus_set_address(b, "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket");
+#else
+ r = sd_bus_set_address(b, "unix:path=/run/dbus/system_bus_socket");
+#endif
ee = bus_address_escape(e);
if (!ee) {
ee = bus_address_escape(e);
if (!ee) {
asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus", (unsigned long) getuid(), ee);
asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus", (unsigned long) getuid(), ee);
+#else
+ b->address = strjoin("unix:path=", ee, "/bus", NULL);
+#endif
+ } else {
+#ifdef ENABLE_KDBUS
asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus", (unsigned long) getuid());
asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus", (unsigned long) getuid());
+#else
+ return -ECONNREFUSED;
+#endif
+ }
if (!b->address) {
r = -ENOMEM;
if (!b->address) {
r = -ENOMEM;