ConditionFirstBoot is never triggered #10
Loading…
Add table
Add a link
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
ConditionFirstBootin 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-iddoes not exist, or/etc/machine-idcontains the valueuninitialized. However,mmdebstrapsimply replaces/etc/machine-idwith an empty file. Instead,mmdebstrapshould replace the contents of/etc/machine-idwithuninitialized. This will preserve the ability to bind-mount over/etc/machine-idwhile 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-idis 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-idis 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 (ConditionFirstBootis never triggered, but themachine-idgets generated correctly).Funnily, the man page referenced from the commit you cite, also explains the
uninializedvalue. I should've RTFM. :DLooks like this is resolved by
3c37d692a0. Thanks!