Skip to main content
Topic: machine-id file in /etc (Read 163 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

machine-id file in /etc

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?

Re: machine-id file in /etc

Reply #1
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:
Code: [Select]
dbus-uuidgen  >| /var/lib/dbus/machine-id
dbus-uuidgen  >| /etc/machine-id

Re: machine-id file in /etc

Reply #2
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.
We should try to be kind to everyone.....we are all fighting some sort of battle.


Re: machine-id file in /etc

Reply #4
/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
so I put the command in /etc/local.d/file.start instead and made it executable which worked, with the local service enabled.

Re: machine-id file in /etc

Reply #5
/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
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.
We should try to be kind to everyone.....we are all fighting some sort of battle.

 

Re: machine-id file in /etc

Reply #6
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:
Code: [Select]
dbus-uuidgen  >| /var/lib/dbus/machine-id
dbus-uuidgen  >| /etc/machine-id


I'd advise against two uuids, just symlink /var/lib/dbus/machine-id to /etc.