forked from denisbrodbeck/machineid
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The machine id is looked in "canonical" locations. If not value is found, one is generated and persisted. The machine id is looked in: - the file pointed by the `MACHINE_ID_FILE` env var - `/var/lib/dbus/machine-id` - `/etc/machine-id` - `$HOME/.config/machine-id` If no such file is found, a random uuid is generated and persisted in the first writable file among `$MACHINE_ID_FILE`, `/var/lib/dbus/machine-id`, `/etc/machine-id`, `$HOME/.config/machine-id`. If there is an error reading _all_ the files an empty string is returned. The logic implemented is a variation of the one described in denisbrodbeck#5 (comment)
- Loading branch information
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters