On Tue, 2 Feb 2021 16:07:24 +0100 David Haller <dnh@opensuse.org> wrote:
Hello,
On Tue, 02 Feb 2021, Carlos E. R. wrote:
On 02/02/2021 13.50, David Haller wrote:
And BTW2: I have this set up:
==== /etc/init.d/boot.local ==== dbus-uuidgen > /etc/machine-id ====
(just symlinking machine-id to /dev/null sadly makes some apps barf)
Who the F came up with that machine-id thing anyway? deadrat again?
What is that thing for? :-? :-o
It's some identifier for your machine. Ah, yes, as I suspected:
https://www.freedesktop.org/software/systemd/man/machine-id.html https://wiki.debian.org/MachineId or generally e.g.: https://www.startpage.com/sp/search?query=/etc/machine-id
What uses it?
Some apps do use it and barf if it's symlinked to /dev/null (i.e. contains nothing).
My "/etc/machine-id" file is dated 2012, and does not contain the same as dbus-uuidgen (I guess I know why)
dbus-uuidgen _generates_ an ID in the required format. Naturally, it'll be (or should be) different! As it seems I need _some_ machine-id (or stuff barfs), I generate a new one on every boot, and as I reboot regularly, that's ok. Otherwise, I'd setup a cron-job to generate one e.g. every hour. Hm. Actually, that's a good idea anyway, fuck the stuff that's using it :) Done:
==== /etc/cron.hourly/gen-machine-id ==== #!/bin/sh dbus-uuidgen > /etc/machine-id ====
*hrhrhr* I'll keep the one in init.d/boot.local, if just for messing with the intention...
[snip]
-dnh
FWIW, Lennart recently posted this on systemd list } I don't suppose you know what requires /etc/machine-id so early in } the boot? PID 1 does. You have to have a valid /etc/machine-id really, everything else is not supported. And it needs to be available when PID 1 initializes. You basically have three options: 1. Make it read-only at boot, initialize persistently on OS install 2. Make it read-only, initialize it to an empty file on OS install, in which case systemd (i.e. PID 1) overmounts it with a random one during early boot. In this mode the system will come up with a new identity on each boot, and thus journal files from previous boots will be considered to belong to different systems. 2b. (Same as 2, but mount / writable during later boot, at which time the machine ID is commited to disk automatically) 3. Make it writable during early boot, and initialize it originally to an empty file. In this case PID 1 will generate a random one and persist it to disk right away. Also see: https://www.freedesktop.org/software/systemd/man/machine-id.html Lennart