Bug 11002

Summary: dbus: user-session dbus.socket contains path from native sysroot
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Nubosch <andreas.kling>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher
Version: 2.4   
Target Milestone: 2.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
replace systemctl path from native sysroot none

Description Nubosch 2017-02-01 10:37:05 UTC
Created attachment 3613 [details]
replace systemctl path from native sysroot

Preconditions/Environment
-------------------------
image with systemd and PACKAGECONFIG_append_pn-dbus="user-session"

Triggering Action/Cause
-----------------------
:~# export XDG_RUNTIME_DIR=/run/user/0
:~# /lib/systemd/systemd --user
:~# systemctl --user start dbus
:~# systemctl --user show-environment

Expectation
-----------
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
...

Actual Result
-------------
missing variable

What really happens

ExecStartPost from dbus.socket tries to launch systemctl from PATH on build machine.

Reproducibility
---------------
1/1
Comment 1 Ross Burton 2017-02-13 16:45:10 UTC
It's probably safer to always set the systemctl assignment in case any other bits of dbus use it in the future.

Can you submit this patch on the mailing list please?

(http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded)
Comment 2 Nubosch 2017-02-14 14:02:36 UTC
(In reply to comment #1)
> It's probably safer to always set the systemctl assignment in case any other
> bits of dbus use it in the future.
> 
> Can you submit this patch on the mailing list please?
> 
> (http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded)

many thanks for your kind advice.

since recipe specific sysroots are used the situation has changed.
user dbus.socket contains /bin/systemctl for target and native builds even without this patch.

dbus does not include sysroot components from systemd-systemctl-native yet, this means the value now refers to installation on the host system determined by $PATH.

Adding systemd-systemctl-native to DEPENDS brings back the old situation with '.../1.10.14-r0/recipe-sysroot-native/usr/bin/systemctl' in user dbus.socket for target and native build.

So I'm sorry to have some questions before submitting a patch to the mailing list. Even if they somehow sound philosophical cause fiddling with systemd user services for native seems weird.

1)
should dbus contain a DEPENDS to systemd-systemctl-native
1a)
and should it be conditional on DISTRO_FEATURES systemd?

2)
should dbus override ac_cv_path_SYSTEMCTL
2a)
and should override be done only for target with EXTRA_OECONF_append_class-target or with EXTRA_OECONF_append? (recipe explicitly sets EXTRA_OECONF_append_class-native = " --disable-selinux")

many thanks in advance

- Andy
Comment 3 Nubosch 2017-02-15 06:16:48 UTC
I gave the minimal change a shot on the mailing list.
Comment 4 Ross Burton 2017-03-20 17:33:16 UTC
Merged in oe-core e9471f8da3946439141ccdd8284200aa614df46c.