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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值