ConditionFirstBoot is never triggered #10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Systemd units which have
ConditionFirstBoot
in their unit file will never run, even on the first boot. This is because systemd determines that it is the first boot if and only if/etc/machine-id
does not exist, or/etc/machine-id
contains the valueuninitialized
. However,mmdebstrap
simply replaces/etc/machine-id
with an empty file. Instead,mmdebstrap
should replace the contents of/etc/machine-id
withuninitialized
. This will preserve the ability to bind-mount over/etc/machine-id
while still triggeringConditionFirstBoot
.Ui, nice catch! Thank you for bringing this up! I'll fix this with the next release.
Note that upon further investigation, it appears that this behavior was introduced in v247. I don't know if there is a way to fix this for systems using older versions of systemd (e.g. Buster). If
/etc/machine-id
is missing and the system comes up with a read-only root, systemd complains:Although, despite the first message, the system boots anyway (but
/etc/machine-id
is not populated). I think the fix proposed in my initial report is still OK, since the behavior for pre-v247-systems is the same as with an empty file (ConditionFirstBoot
is never triggered, but themachine-id
gets generated correctly).Funnily, the man page referenced from the commit you cite, also explains the
uninialized
value. I should've RTFM. :DLooks like this is resolved by
3c37d692a0
. Thanks!