Skip to contentSkip to conversation

dbus missing /var/lib/dbus directory

Buildroot Michael J. Hammel 2 participants 3 messages May 17, 2012 – May 18, 2012

lore
Share & tools
lore
#0 lore raw

I enabled NetworkManager, which got me dbus, but then disabled NetworkManager, but dbus remained (that part is okay). I noticed today that the init script for dbus tries to run dbus-uuidgen but fails with a message about not being able to open /etc/machine-id. I dug around and then strace'd dbus-uuidgen and found that if /var/lib/dbus is present this message goes away.

Should the init script also try to create /var/lib/dbus with "mkdir -p"? Of is that something the specific rootfs needs to address on its own?

Signature · 1 line
Michael J. Hammel <[email protected]>
#1 lore raw

Le Wed, 16 May 2012 21:23:57 -0600,
"Michael J. Hammel" <[email protected]> a ?crit :

Quoted 2 lines

I enabled NetworkManager, which got me dbus, but then disabled NetworkManager, but dbus remained (that part is okay).

That's the normal kconfig behavior. The NetworkManager package "selects" the D-Bus package, so when you enable the NetworkManager package, it automatically enables D-Bus. But when you disable NetworkManager, it doesn't automatically disable D-Bus.

Quoted 7 lines

I noticed today that the init script for dbus tries to run dbus-uuidgen but fails with a message about not being able to open /etc/machine-id. I dug around and then strace'd dbus-uuidgen and found that if /var/lib/dbus is present
this message goes away.

Should the init script also try to create /var/lib/dbus with "mkdir -p"? Of is that something the specific rootfs needs to address on its own?

Well, it should rather be done at build time, when the D-Bus package is built. And, reading the code, it actually is created:

define DBUS_INSTALL_TARGET_FIXUP

        rm -rf $(TARGET_DIR)/var/lib/dbus
        ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
        $(INSTALL) -m 0755 -D package/dbus/S30dbus $(TARGET_DIR)/etc/init.d/S30dbus

endef

DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP

It doesn't exist in your filesystem?

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw
Quoted 7 lines · Thomas Petazzoni

define DBUS_INSTALL_TARGET_FIXUP

        rm -rf $(TARGET_DIR)/var/lib/dbus
        ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
        $(INSTALL) -m 0755 -D package/dbus/S30dbus $(TARGET_DIR)/etc/init.d/S30dbus

endef

It doesn't exist in your filesystem?

Ah. There's the reason. I wipe /tmp on boot so I can create a custom directory structure in a tmpfs. I'll add support for /var/lib/dbus there if I decide to keep dbus.

Thanks for the tip Thomas.

Signature · 1 line
Michael J. Hammel <[email protected]>