Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HostID to Host #237

Merged
merged 4 commits into from
Aug 11, 2016
Merged

Add HostID to Host #237

merged 4 commits into from
Aug 11, 2016

Conversation

sean-
Copy link
Contributor

@sean- sean- commented Aug 11, 2016

Add host.Info().HostID which returns a "durable-enough" UUID to distinguish a host.

On supported hosts the value returned is a UUID (case preserving
from the value of the underlying OS).

For Linux this is generated once, randomly per boot.  For FreeBSD and
Darwin this is a more durable value that should persist across reboots.
before falling back to kernel.random.boot_id.

`/sys/class/dmi/id/product_uuid` is still managed by permissions, so
for root-run processes where `/sys/class/dmi/id/product_uuid` is
available, the host's UUID will be used instead, otherwise the UUID
from kernel.random.boot_id will be used instead.
@shirou
Copy link
Owner

shirou commented Aug 11, 2016

Very interesting contribution. Thanks a lot!

@shirou shirou merged commit 1cc18d9 into shirou:master Aug 11, 2016
@sean- sean- deleted the f-host-id branch August 11, 2016 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants