denisbrodbeck / machineid

Get the unique machine id of any host (without admin privileges)
MIT License
985 stars 139 forks source link

OpenBSD uses machine-id #9

Open jungle-boogie opened 5 years ago

jungle-boogie commented 5 years ago

Hi,

This originated here: https://github.com/schollz/croc/issues/137

Your readme states: BSD uses /etc/hostid

However, OpenBSD uses /etc/machine-id:

$ ls -l /etc/machine-id 
-rw-r--r--  1 root  wheel  33 May  1  2018 /etc/machine-id

I don't know go, so I don't know where to fit this update into your file: https://github.com/denisbrodbeck/machineid/blob/master/id_bsd.go

CyrilBrulebois commented 3 years ago

Hi, just passing through before filing my own issue…

Maybe you could reuse the logic from id_linux.go, trying to read a file and falling back to another one if the first attempt doesn't succeed?

Cheers, Cyril.

rnagy commented 3 years ago

OpenBSD does not use machine-id. /etc/machine-id comes from dbus.

jungle-boogie commented 3 years ago

@rnagy,

Oh, I'm sorry! thanks for correcting me.