Comment # 10 on bug 1191892 from
(In reply to Christian Boltz from comment #9)
> Sorry, I'm not too keen to do such testing on a production system.
> However, I'd be very surprised if /etc/machine-id would temporarily exist
> during boot and then get deleted again before I can check it in a "normal"
> boot. (OTOH, it's surprising that the system boots without /etc/machine-id,
> see below.)

Indeed I don't think /etc/machine-id have temporarily existed neither.

Nevertheless if the file was missing from the beginning, systemd should have
warned you and emitted the error message you mentioned in your previous
comment.

I don't think the system fails to boot if machine-id is missing. However some
tools such as journald or networkd might miss-behave.

> One thing I checked is the content of the initrd - lsinitrd shows that it
> contains an empty machine-id file:
>   -rw-r--r--   1 root     root            0 Oct 21 10:22 etc/machine-id
> which is probably the result of generating the initrd while /etc/machine-id
> didn't (and doesn't) exist.

Indeed and in that case systemd temporarily generates a machine-id until the
one defined in the rootfs takes over.

> I know that all this doesn't explain why /etc/machine-id on the production
> server is missing (and why it still boots), and I'm afraid I can't do any
> tests on the production system that come with the risk of causing downtime.

An empty /etc/machine-id is probably missing from the Hetzner image, which is
surprising since the installation of systemd is supposed to create one.

I don't know how well this image is supported but if that's really the case,
the problem probably lies in the generation of the image.

> Is there a way to restore /etc/machine-id (ideally with the right value)
> that I can run on the production server?

There's the tool "systemd-machine-id-setup" which is used to init a brand new
machine-id, see its man page. However it might be worth to look at the content
of /var/log/journal since journald places its journal files in the directory
named after the machine-id.

Also note that if you create the file manually, it should have the 0444 perms.


You are receiving this mail because: