diff options
Diffstat (limited to 'vendor/github.com/rs/xid/hostid_linux.go')
-rw-r--r-- | vendor/github.com/rs/xid/hostid_linux.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/rs/xid/hostid_linux.go b/vendor/github.com/rs/xid/hostid_linux.go index 7d0c4a9e..837b2043 100644 --- a/vendor/github.com/rs/xid/hostid_linux.go +++ b/vendor/github.com/rs/xid/hostid_linux.go @@ -5,6 +5,9 @@ package xid import "io/ioutil" func readPlatformMachineID() (string, error) { - b, err := ioutil.ReadFile("/sys/class/dmi/id/product_uuid") + b, err := ioutil.ReadFile("/etc/machine-id") + if err != nil || len(b) == 0 { + b, err = ioutil.ReadFile("/sys/class/dmi/id/product_uuid") + } return string(b), err } |