[Buildroot] BUG: systemd/dbus broken in -rc1

Romain Naour romain.naour at gmail.com
Wed Feb 21 22:13:18 UTC 2018


Hi Baruch,

Le 21/02/2018 à 18:22, Baruch Siach a écrit :
> Hi Jérémy,
> 
> On Wed, Feb 21, 2018 at 01:42:32PM +0100, Jérémy Rosen wrote:
>> I have a systemd course where I use a minimal buildroot system as my
>> exercise machine.
>> It is a very minimal configuration based on 86_64+systemd+not much else.
>>
>> since the update of systemd to v237 there has been various problems related
>> to the
>> connexion between systemd and dbus. The easiest way to test is to run
>> "busctl" on
>> the system. It won't work complaining about "no such file or directory"
>>
>> This bug affects more or less all systemd-provided utilities, including
>> logind and systemd
>> itself.
>>
>> After investigating, the problem is that systemd looks for the dbus socket
>> in /run/dbus instead of
>> /var/run/dbus which is not where dbus puts the socket.
>>
>> However, systemd mandates that /run be a symlink to /var/run. The file
>> /usr/lib/tmpfiles.d/var.con
>> will create automatically that symlink at bootup. So in theory, looking at
>> the socket in /run should
>> work too.
>>
>> However, there is a second stacked bug. dbus creates, at install time, the
>> directory /var/run/dbus.
>> This breaks tmpfile.d which will not create the symlink since the directory
>> already exists.
>> Creating a file in /var/run makes no sense in the first place since that
>> directory is a tmpfs and will
>> be emptied at reboot time
>>
>> Now, I am not sure what to do from here on the buildroot side. I think it
>> could be usefull to have
>> some sort of security to check that /var/run doesn't exist and yell loudly
>> if it does, but I don't know
>> how to implement that
>>
>> An other approch would be for the systemd skeleton to create /var/run as a
>> symlink to ../run
>> (not /run) in order to let stuff be installed. The tmpfs mount at boot time
>> would hide the content,
>> but it should work
>>
>> To sum it up :
>> * systemd should look for the socket in /var/run :
>> https://github.com/systemd/systemd/issues/8197
>> * dbus should not create the /run/dbus directory in the first place : bug to
>> be opened
>> * buildroot needs to make sure /var/run is not created or is a correct
>> symlink.
>>
>> I'd gladly take advice on what to do to move forward on that issue...
> 
> The patch of Jan Kundrát at http://patchwork.ozlabs.org/patch/870834/ might 
> solve your last issue. Not sure about the rest.

This patch doesn't solve Jérémy's issue since it only for the rootfs RO case.

define SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW
 	echo "/dev/root / auto rw 0 1" >$(TARGET_DIR)/etc/fstab
 	mkdir -p $(TARGET_DIR)/var
+	ln -s ../run $(TARGET_DIR)/var/run
 endef

Adding a symlink for the read-write case allow to make systemd work with dbus
but we have /run/dbud in the target directory (which will be hidden by the tmpfs
mount).

Romain

> 
> baruch
> 




More information about the buildroot mailing list