mirror of https://github.com/shirou/gopsutil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
On Linux, most golang programs do not run as root (or at least, they should not), by default, the kernels uses strict permissions, so most userland programs cannot read `/sys/class/dmi/id/product_uuid`. However, programs such as Consul are relying on it to get fixed IDs, instead they have a different ID on each boot. We propose to use `/etc/machine-id` as fallback https://www.freedesktop.org/software/systemd/man/machine-id.html In order to fix this, this patch does the following: - if `/sys/class/dmi/id/product_uuid` can be read, use it for HostID - else if `/etc/machine-id` exists and has 32 chars, use it and add '-' to have the same format as product_uuid - finally, if notthing works, use the `kernel.random.boot_id` This will greatly increase the number of programs having correct behaviour when those rely on having a fixed HostID. This will fix the following issues: - https://github.com/shirou/gopsutil/issues/350 - https://github.com/hashicorp/consul/issues/4741 |
7 years ago | |
---|---|---|
.. | ||
host.go | 7 years ago | |
host_darwin.go | 7 years ago | |
host_darwin_386.go | 9 years ago | |
host_darwin_amd64.go | 9 years ago | |
host_fallback.go | 7 years ago | |
host_freebsd.go | 7 years ago | |
host_freebsd_386.go | 9 years ago | |
host_freebsd_amd64.go | 9 years ago | |
host_freebsd_arm.go | 9 years ago | |
host_linux.go | 7 years ago | |
host_linux_386.go | 9 years ago | |
host_linux_amd64.go | 9 years ago | |
host_linux_arm.go | 9 years ago | |
host_linux_arm64.go | 9 years ago | |
host_linux_mips.go | 8 years ago | |
host_linux_mips64.go | 7 years ago | |
host_linux_mips64le.go | 7 years ago | |
host_linux_mipsle.go | 8 years ago | |
host_linux_ppc64le.go | 9 years ago | |
host_linux_s390x.go | 9 years ago | |
host_linux_test.go | 11 years ago | |
host_openbsd.go | 7 years ago | |
host_openbsd_amd64.go | 9 years ago | |
host_solaris.go | 7 years ago | |
host_test.go | 7 years ago | |
host_windows.go | 7 years ago | |
types_darwin.go | 11 years ago | |
types_freebsd.go | 9 years ago | |
types_linux.go | 9 years ago | |
types_openbsd.go | 9 years ago |