Bug 269310 - devel/dbus: /var/lib/dbus/machine-id not created
Summary: devel/dbus: /var/lib/dbus/machine-id not created
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-03 13:47 UTC by mkamm
Modified: 2023-02-04 23:02 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (desktop)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mkamm 2023-02-03 13:47:00 UTC
I installed dbus with "pkg install dbus" on 13.1-release and noticed that the uuid had not been created.

Running "dbus-uuidgen --ensure" solved the problem.
Comment 1 Tatsuki Makino 2023-02-03 21:42:37 UTC
(In reply to mkamm from comment #0)

It runs when /usr/local/etc/rc.d/dbus is used.

With dbus_enable="YES" written in /etc/rc.conf, the entire OS is restarted, or simply by running the service dbus start it is used.
Comment 2 mkamm 2023-02-04 07:45:50 UTC
A bug is a bug even if it shows up only under certain conditions!

As a user I installed roxterm (which depends on dbus) with pkg and had the reasonable expectation that dependencies would be handled.
IT DID NOT WORK.
Having the PR closed immediately turned me off from FreeBSD the first day after a fresh installation. (Going back to Linux.)
Comment 3 Charlie Li freebsd_committer 2023-02-04 12:57:21 UTC
Pilot error is not a bug. D-Bus does have to be enabled as a daemon for it and consumers to work properly. The task of enabling daemons to start on system startup is explicitly for the user to handle. There are never good reasons for daemons to be automatically enabled on install.
Comment 4 mkamm 2023-02-04 13:09:46 UTC
I consider it a system error rather than a pilot error.
When installing dbus as a dependency there is no indication whatsoever, that additional action is required. A clear violation of the POLA principle.

But never mind! I turned back to Linux where package management is more professional and user communication frindlier. Therefore this PR isn't relevant any more to me.
Comment 5 Charlie Li freebsd_committer 2023-02-04 13:23:15 UTC
We can add a pkg-message as a courtesy, to remind everyone to enable the dbus service/daemon if not already. But there exist use cases where enabling the dbus service/daemon is not desirable, for instance when a consumer only needs to link to the library, but said consumer is used on a non-desktop/workstation scenario. POLA goes both ways.

I don't know which Linux distribution you came from, but far from all of them will hold your hand on matters like this. I myself had a rude awakening to how things worked here when I first started using FreeBSD, and I was already used to something that required more user "intervention" to configure.
Comment 6 mkamm 2023-02-04 13:36:01 UTC
I admit you have a point with the library-only dependency case.

But in my case I installed roxterm as one of the very first packages on a brand new virtual FreeBSD machine and got no error indication at install time.
I did not have to enable any service. Just running the uuid creation command fixed it. (Luckily a runtime error message hinted to that remedy.) So why is the uuid not generated automatically rather than manually or delayed until next reboot? What adverse effects would automatic uuid generation at installation time have?

And yes, Linux is not perfect either. ;-)
Comment 7 Charlie Li freebsd_committer 2023-02-04 22:06:11 UTC
And D-Bus isn't the greatest at indicating its error conditions either :-)

I opened review D38384 to see how to best word the reminder to enable/start the dbus service. Running dbus-uuidgen(1) post-install rather than service start isn't really in the cards until some other issues are clarified and resolved, particularly with dangling files possibly still managed by pkg(8).
Comment 8 Tatsuki Makino 2023-02-04 23:02:14 UTC
There are several issues regarding the file named machine-id.
bug 218750, bug 247175, etc...

There is discussion of using /bin/uuidgen to make them in advance, but the format is slightly different from /usr/local/bin/dbus-uuidgen.

The hard-coded paths that conform to Linux are troubling FreeBSD :)