12

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

eri
  • 865
  • 2
  • 8
  • 16

1 Answers1

8

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.

Thomas Nyman
  • 29,912
  • 10
  • 65
  • 77