systemd - missing /etc/machine-id after installation

René Bleisch accounts at climate.unibe.ch
Thu Jan 12 14:31:00 CET 2017


Hi,
I just stumbled over a systemd/journald related problem which may also 
affect FAI installations.

Some days ago, when booting a freshly installed PC (Debian jessie) for 
the first time, journald could not be started, which means there is no 
error logging at all:
"systemd[1]: Failed to start Journal Service"

I quickly found out the essential problem:
systemd[1]: Cannot open /etc/machine-id: No such file or directory

The  file "/etc/machine-id" contains "the unique machine ID of the local 
system that is set during installation" (see "man machine-id").
Apparently systemd refuses to start journaling if this file is missing.

I could easily fix the problem by generating the file with 
"/usr/bin/systemd-machine-id-setup". After rebooting all worked well.

Up to now I completely ignored the presence of "/etc/machine-id". I 
guess I'm not the only one.

Despite the importance of this "/etc/machine-id" file, it seems to be 
more or less neglected in systemd documentations*.
=> this fits perfectly into my general impression of systemd and its 
maintainers. They have good ideas, but often their implementation is not 
too well - e.g. the entire system relies on the presence of one single 
file (?!) - and they seem to have poor manners towards the users ...

I was able to find at least one source of my problems.
"/etc/machine-id" must come directly from the basefile - therefore its 
always the same file with the same ID on all my installed clients ...
Further I just recreated my jessie-nfsroot before installing the new PC, 
thereby the default basefile was also recreated - but this time without 
"/etc/machine-id" in it, it seems. I don't have any clue why this happened.

I now added a script to my config/tests, which checks if 
"/etc/machine-id" is present after installation. If not, the script runs 
"/usr/bin/systemd-machine-id-setup" on the install host to generate an ID.

Maybe it would be an idea to include such a subroutine into the main 
FAI-program, eg. at the end of "task_instsoft" or during "task_finish".
What do you mean, Thomas?

At least l think its worth considering how to cope with 
"/etc/machine-id" on FAI-installations, because it seems to be such a 
central file for systemd, which in turn became more or less the default 
init-system on Debian and Ubuntu-sytems - if we like it or not ...

By the way:
Thomas, many thanks for your great support efforts - that's how it 
should always be!
Its impressive how you always take your time for the needs of the FAI-users.

Regards
René


* Recently I worked myself through quite a lot of systemd manuals and 
documentations to improve my knowledge of how systemd works - a bit like 
opening Pandora's Box, I know ...  I'm pretty sure, I never stumbled 
over this file.

||
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20170112/9b884509/attachment.html>


More information about the linux-fai mailing list