Page MenuHomeFreeBSD

devel/dbus: Generate machine-id on install
AbandonedPublic

Authored by 0mp on May 6 2018, 1:55 PM.
Tags
None
Referenced Files
F81522304: D15324.id.diff
Wed, Apr 17, 12:22 PM
F81522302: D15324.id79348.diff
Wed, Apr 17, 12:22 PM
F81522299: D15324.id42204.diff
Wed, Apr 17, 12:22 PM
F81522295: D15324.id79349.diff
Wed, Apr 17, 12:22 PM
F81522290: D15324.id79375.diff
Wed, Apr 17, 12:22 PM
F81519833: D15324.diff
Wed, Apr 17, 11:38 AM
Unknown Object (File)
Sat, Apr 6, 2:15 AM
Unknown Object (File)
Fri, Apr 5, 9:23 AM

Details

Reviewers
bapt
adridg
tcberner
tobik
Group Reviewers
O5: Ports Framework(Owns No Changed Paths)
portmgr
Summary

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228001

On new systems installing any application that uses the D-Bus library will abort with

D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/etc/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.

The reason for this is that ports r347320 removed @postexec dbus-uuidgen --ensure from the plist of devel/dbus to appease Poudriere in strict mode. So the machine-id is never generated until users start the D-Bus service (which not every wants to do) or run dbus-uuidgen --ensure manually afterwards. There are many support request for this on the FreeBSD forums and FreeBSD is also unique in subjecting users to this procedure.

This reintroduces generating the machine-id on install but also whitelists /var/lib/dbus/machine-id in Mk/Scripts/check_leftovers.sh so that Poudriere does not complain about leftover files.

Note that almost any functional FreeBSD desktop must have /var/lib/dbus/machine-id and it must remain the same across package installs/deinstalls so we cannot just track it in pkg-plist via an additional @postunexec.

Test Plan

Check with poudriere testport that /var/lib/dbus/machine-id exists in the jail after install of dbus.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 34708
Build 31766: arc lint + arc unit

Event Timeline

The dbus change is approved. You still need portmgr@ for the Mk/ part as I don't have any say over that.

In D15324#327639, @kwm wrote:

The dbus change is approved. You still need portmgr@ for the Mk/ part as I don't have any say over that.

Thank you.

I'm abandoning this though because it has been open for too long and I don't care anymore.

0mp added a reviewer: tobik.

I wonder if instead of modifying Mk/Scripts/check_leftovers.sh we could run something like @postunexec rm /var/lib/dbus/machine-id.

Use @postexec and @postunexec to install the machine-id file and remove it on dbus deinstallation.

0mp planned changes to this revision.Nov 9 2020, 2:06 PM

Whoops, wait, I just realized that this way it won't work in Poudriere in strict mode. I'll investigate a bit more.

0mp retitled this revision from devel/dbus: Generate machine-id on install and whitelist it in check_leftovers.sh to devel/dbus: Generate machine-id on install.Nov 9 2020, 2:07 PM
devel/dbus/pkg-plist
62

This will break dbus, when dbus is already running on a machine.

devel/dbus/pkg-plist
62

Yes, I've just realized that a few moment ago. Thank you for confirming that it might be an issue.

The machine-id file is already being created when the dbus service starts. It makes no sense to try to create it during installation. The only potentially interesting thing could be to try to remove the file on dbus deinstallation, but I am not going to pursue this.

In D15324#606119, @0mp wrote:

The machine-id file is already being created when the dbus service starts. It makes no sense to try to create it during installation. The only potentially interesting thing could be to try to remove the file on dbus deinstallation, but I am not going to pursue this.

If I remember it correcty, this whole issue was that other programs that look for the machine-id file when dbus wasn't running (so the file wasn't created yet) where crashing.

Remove problematic @rmtry. After some disussions with bapt@ on IRC it seems like a simple post-installation script should be enough.

  • Use a pkg-install script instead of @postexec to run dbus-uuidgen. I've tried to make it rootdir compatible, but I am not sure if I got it right.
  • Ignore the machine-id file via check_leftovers.sh.
  • Introduce an option to disable automatic generation of the machine-id file.
tcberner added a subscriber: tcberner.

Moin moin

as /etc/machine-id is now generated by rc, this is likely no longer required.

We should however make sure that we do not patch the /etc/machine-id location to something else anymore :)

mfg Toibas

This revision now requires changes to proceed.Sat, Mar 23, 1:40 PM