I noticed today, there is a file named machine-id under` /etc`. What it is for? Does it serve as an unique identifier for repositories? Could someone explain and educate?
It's used/created by dbus. It's a unique identifier of your box and there's another in /var/lib/dbus/. In our community ISOs, there's a script that changes it at every boot.
If you are concerned, you can change it as well at boot or with cron:
dbus-uuidgen >| /var/lib/dbus/machine-id
dbus-uuidgen >| /etc/machine-id
Thank you
@nous for the information. Where can I find the script to change machine-id at boot and how to apply it?
I am running Artix Plasma, but it is a self-constructed version and therefore does not have this script.
Best regards.
Just put those dbus-uuidgen commands in your /etc/rc.local!
/var/lib/dbus and thus /var/lib/dbus/machine-id doesn't exist at all on my system, while /etc/machine-id does. Hasn't seemed to cause problems.
I didn't have an /etc/rc.local, although I could have made one like this:
https://wiki.artixlinux.org/Main/OpenRC#rc.local (https://wiki.artixlinux.org/Main/OpenRC#rc.local)
so I put the command in /etc/local.d/file.start instead and made it executable which worked, with the local service enabled.
I followed your method as well...works as expected. :)
Best regards.
I'd advise against two uuids, just symlink /var/lib/dbus/machine-id to /etc.
For anyone who comes here by some search on the topic, and a follow-up:
There is now a package in the AUR which does this:
random_machine_id-openrc (https://aur.archlinux.org/packages/random_machine_id-openrc).
Is changing the machine ID during runtime of
dbus supported and does not lead to strange behaviour?
By the way,
/var/lib/dbus/machine-id does no longer exist (I don't have a
/var/lib/dbus/ at all).
random_machine_id-openrc (https://aur.archlinux.org/packages/random_machine_id-openrc) caters for that since it tests the existence of
/var/lib/dbus/.
Maybe someone with Wiki edit rights can also put the information into the corresponding wiki page (https://wiki.artixlinux.org/Main/Troubleshooting#I.27m_having_dbus-related_problems_and_I_keep_seeing_messages_about_.2Fetc.2Fmachine-id)?