UUIDs

This blog post is a part of “the things I learned while working on popcorn”, Popcorn tracks usage of linux packages. Ionuț Arțăriși is my mentor for this GSoC project for openSUSE.

Popcorn requires UUIDs (Universally unique IDs) so that it doesn’t receive submissions from the same system again before a certain period of time.

We used to use smolt id, but smolt package is not present in all Linux distributions.

So on a quest to find a universally unique ID that is present on all distributions, Petr Uzel pointed me to Lennart’s Blog Post.

tl;dr use/var/lib/dbus/machine-id if you are looking for a globally unique id for a Linux system.

Hardware IDs:

The problems with hardware IDs are that:

Software IDs:

We can combine locally unique ids with /var/lib/dbus/machine-id to generate globally unique ids for a particular user or session.

Generating UUIDs:

You can also generate UUIDs using uuidgen command or simply read 16 bytes from /dev/random