SemkoDev / field.cli

WE HAVE MOVED TO A NEW REPOSITORY
https://gitlab.com/semkodev/field.cli
ISC License
34 stars 7 forks source link

Some clients are using the same "id" #3

Closed one-three-three-seven closed 6 years ago

one-three-three-seven commented 6 years ago

Because some servers are running with the same baseimage, these machines do have the same machine-id.

https://www.npmjs.com/package/node-machine-id

Take a look at "Caveats" at the bottom of the page.

romansemko commented 6 years ago

Added the caveat to the README. Thanks for pointing out!

glumb commented 6 years ago

I am not sure if its a good idea to advise people to change their machine-id. Especially without a word of warning.

Why not generate some ID file .fiels_cli_id.txt, create a unique hash/ID on first execution and read it on successive program starts?

romansemko commented 6 years ago

Fair enough. Will need to think it through regarding generating custom ID file. I wanted to avoid it, to be honest.

glumb commented 6 years ago

Is the MAC address sufficient for creating an id?

one-three-three-seven commented 6 years ago

When you cloning a virtual machine these do have the same MAC, if not changed while cloning. (As example)

Best (and maybe only "safe") way is to use a random id.

antonionardella commented 6 years ago

Hi, I'm using docker images, and this images do not contain the /var/lib/dbus/machine-id or dbus-uuidgen therefore the ID cannot be created/renewed.

Any ideas?

romansemko commented 6 years ago

do you have /etc/machine-id ?

antonionardella commented 6 years ago

does not look like it is there:

/usr/src/field # ls /etc/

TZ               init.d/          network/         securetty
alpine-release   inittab          opt/             services
apk/             issue            os-release       shadow
conf.d/          localtime        passwd           shadow-
crontabs/        logrotate.d/     passwd-          shells
fstab            modprobe.d/      periodic/        ssl/
group            modules          profile          sysctl.conf
group-           modules-load.d/  profile.d/       sysctl.d/
hostname         motd             protocols        udhcpd.conf
hosts            mtab             resolv.conf
MatthiasLohr commented 6 years ago

The problem exists also with docker images,

@romansemko, what's the reason for avoiding it?

romansemko commented 6 years ago

Will add optional custom machine ID generation.