systemd-journald[308]: Failed to open runtime journal: No such file or directory

Issue: systemd does not create new machine-id file if none is present

It is not what you really want to run systemd-firstboot [1] at every firstboot so you flush it status and have it run again? 

1. https://www.freedesktop.org/software/systemd/man/systemd-firstboot.html

 

So if we put an empty /etc/machine-id file in place (say "touch /etc/machine-id" it will regenerate a new machine-id in the empty file, if the file isn't there it won't do anything. This seems like a bug to me as opposed to any particular service.
https://www.freedesktop.org/software/systemd/man/machine-id.html
https://www.freedesktop.org/software/systemd/man/systemd-machine-id-setup.html


If the system ( or part of it ) is spectacular failing without that file that's more cause for concern than just an empty file.

In anycase can you try this type service unit as an workaround in the meantime

regenerate-machineid.service

[Unit]
Description=Generate New Machine ID
Documentation=man:systemd-firstboot(1)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=systemd-sysusers.service sysinit.target shutdown.target
ConditionPathIsReadWrite=/etc
ConditionPathExists=!/etc/machine-id

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/systemd-firstboot --setup-machine-id

[Install]
WantedBy=sysinit.target

 

你可能感兴趣的:(运维)