denisbrodbeck / machineid

Get the unique machine id of any host (without admin privileges)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenBSD uses machine-id

jungle-boogie opened this issue · comments

Hi,

This originated here:
schollz/croc#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

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.

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

@rnagy,

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