diff mbox series

[v2,1/1] dbus: add traditional-activation PACKAGECONFIG

Message ID 20250722113250.255487-2-pascal.weisser.ext@karlstorz.com
State New
Headers show
Series Add traditional-activation PACKAGECONFIG to DBus recipe. | expand

Commit Message

Weisser, Pascal July 22, 2025, 11:32 a.m. UTC
Add traditional-activation PACKAGECONFIG to DBus recipe in order to allow
users to enable or disable traditional DBus service activation.

DBus service activation refers to automatically starting an application
when a DBus message is sent to a service provided by that application.
Traditionally, this is done by the DBus-daemon, thus, the term traditional
here. On systems using systemd, systemd can do this, instead.

On some systems it might be of interest to disable the traditional service
activation in order to ensure that services are always started via systemd.

Per default, traditional service activation is enabled for DBus. Thus, the
traditional-activation PACKAGECONFIG is added to the default PACKAGECONFIG.
Otherwise, we might introduce a breaking change here.

The binary dbus-daemon-launch-helper isn't created in case DBus is built
with traditional service activation disabled, so we change its attributes
only when traditional service activation is turned on.

Signed-off-by: Weisser, Pascal <pascal.weisser.ext@karlstorz.com>
---
 meta/recipes-core/dbus/dbus_1.16.2.bb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Alexander Kanavin July 22, 2025, 3:29 p.m. UTC | #1
Thanks for additional explanations, this looks fine.

Alex

On Tue, 22 Jul 2025 at 13:33, Weisser, Pascal.ext via
lists.openembedded.org
<Pascal.Weisser.ext=karlstorz.com@lists.openembedded.org> wrote:
>
> Add traditional-activation PACKAGECONFIG to DBus recipe in order to allow
> users to enable or disable traditional DBus service activation.
>
> DBus service activation refers to automatically starting an application
> when a DBus message is sent to a service provided by that application.
> Traditionally, this is done by the DBus-daemon, thus, the term traditional
> here. On systems using systemd, systemd can do this, instead.
>
> On some systems it might be of interest to disable the traditional service
> activation in order to ensure that services are always started via systemd.
>
> Per default, traditional service activation is enabled for DBus. Thus, the
> traditional-activation PACKAGECONFIG is added to the default PACKAGECONFIG.
> Otherwise, we might introduce a breaking change here.
>
> The binary dbus-daemon-launch-helper isn't created in case DBus is built
> with traditional service activation disabled, so we change its attributes
> only when traditional service activation is turned on.
>
> Signed-off-by: Weisser, Pascal <pascal.weisser.ext@karlstorz.com>
> ---
>  meta/recipes-core/dbus/dbus_1.16.2.bb | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/dbus/dbus_1.16.2.bb b/meta/recipes-core/dbus/dbus_1.16.2.bb
> index 65f7028b4f..aabc4c3efb 100644
> --- a/meta/recipes-core/dbus/dbus_1.16.2.bb
> +++ b/meta/recipes-core/dbus/dbus_1.16.2.bb
> @@ -28,7 +28,7 @@ EXTRA_OEMESON = "-Dxml_docs=disabled \
>                  "
>
>  PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
> -                   user-session \
> +                   traditional-activation user-session \
>                    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
>                    "
>  PACKAGECONFIG:class-native = ""
> @@ -36,6 +36,7 @@ PACKAGECONFIG:class-nativesdk = ""
>
>  PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd_system_unitdir=${systemd_system_unitdir},-Dsystemd=disabled,systemd"
>  PACKAGECONFIG[x11] = "-Dx11_autolaunch=enabled,-Dx11_autolaunch=disabled, virtual/libx11 libsm"
> +PACKAGECONFIG[traditional-activation] = "-Dtraditional_activation=true,-Dtraditional_activation=false"
>  PACKAGECONFIG[user-session] = "-Duser_session=true -Dsystemd_user_unitdir=${systemd_user_unitdir},-Duser_session=false"
>  PACKAGECONFIG[verbose-mode] = "-Dverbose_mode=true,-Dverbose_mode=false,,"
>  PACKAGECONFIG[audit] = "-Dlibaudit=enabled,-Dlibaudit=disabled,audit"
> @@ -152,8 +153,11 @@ do_install:append:class-target() {
>
>         chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
>
> -       chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
> -       chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
> +       if [ "${@bb.utils.contains('PACKAGECONFIG', 'traditional-activation', '1', '0', d)}" = "1" ]
> +       then
> +               chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
> +               chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
> +       fi
>
>         # Remove Red Hat initscript
>         rm -rf ${D}${sysconfdir}/rc.d
> --
> 2.50.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#220735): https://lists.openembedded.org/g/openembedded-core/message/220735
> Mute This Topic: https://lists.openembedded.org/mt/114284562/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-core/dbus/dbus_1.16.2.bb b/meta/recipes-core/dbus/dbus_1.16.2.bb
index 65f7028b4f..aabc4c3efb 100644
--- a/meta/recipes-core/dbus/dbus_1.16.2.bb
+++ b/meta/recipes-core/dbus/dbus_1.16.2.bb
@@ -28,7 +28,7 @@  EXTRA_OEMESON = "-Dxml_docs=disabled \
                 "
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
-                   user-session \
+                   traditional-activation user-session \
                   ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
                   "
 PACKAGECONFIG:class-native = ""
@@ -36,6 +36,7 @@  PACKAGECONFIG:class-nativesdk = ""
 
 PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd_system_unitdir=${systemd_system_unitdir},-Dsystemd=disabled,systemd"
 PACKAGECONFIG[x11] = "-Dx11_autolaunch=enabled,-Dx11_autolaunch=disabled, virtual/libx11 libsm"
+PACKAGECONFIG[traditional-activation] = "-Dtraditional_activation=true,-Dtraditional_activation=false"
 PACKAGECONFIG[user-session] = "-Duser_session=true -Dsystemd_user_unitdir=${systemd_user_unitdir},-Duser_session=false"
 PACKAGECONFIG[verbose-mode] = "-Dverbose_mode=true,-Dverbose_mode=false,,"
 PACKAGECONFIG[audit] = "-Dlibaudit=enabled,-Dlibaudit=disabled,audit"
@@ -152,8 +153,11 @@  do_install:append:class-target() {
 
 	chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
 
-	chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
-	chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+	if [ "${@bb.utils.contains('PACKAGECONFIG', 'traditional-activation', '1', '0', d)}" = "1" ]
+	then
+		chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+		chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+	fi
 
 	# Remove Red Hat initscript
 	rm -rf ${D}${sysconfdir}/rc.d