How dbus calculates machine id

d-bus

How DBus calculates machine id? (/etc/machine-id, /var/lib/dbus/machine-id).
Which way is more correct to determine it?

Best Answer

The machine ID in /etc/machine-id is usually randomly generated at system install by systemd-machine-id-setup. On stateless systems it can also be generated at system boot. The format of the file originates from /var/lib/dbus/machine-id introduced by D-Bus.

The /var/lib/dbus/machine-id file is randomly generated by dbus-uuidgen, typically invoked by the post-install script of a D-Bus package. It can also be a symlink to /etc/machine-id.

Related Question