/etc/machine-id is not unique!

I have some software that uses the unique /etc/machine-id as a key. But I just noticed tonight that the machine-id is exactly the same on all beaglebones!

If this has been fixed recently, let me know. The builds I’m using are from January 2017, though I don’t recall exactly when.

All of the devices I have seem to be using this ID:

$ cat /etc/machine-id

31ed5be0bb5b4026a4c72cfcfe792e44

I tried to run the command I found online, but…:

$ sudo systemd-machine-id-setup

Initializing machine ID from D-Bus machine ID.

$ cat /etc/machine-id

31ed5be0bb5b4026a4c72cfcfe792e44

Does that mean the D-Bus machine ID should be unique and somehow isn’t?

What is the correct way to generate a new machine-id and/or a D-Bus machine ID?

Stéphane

What is the correct way to generate a new machine-id and/or a D-Bus machine ID?

I think I figured it out. Robert, is this something that should be part of an image? Either deleting the files from the image so new ones are auto-generated, or ensuring unique IDs are created?

Here is how I generated unique ID on each of my beaglebone devices:

sudo rm -f /var/lib/dbus/machine-id

sudo rm -f /etc/machine-id

sudo dbus-uuidgen --ensure

sudo systemd-machine-id-setup

Stéphane