-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/etc/machine-id not persistent #574
Comments
running although this should be ran by |
Where is that coming from? |
I believe from systemd. per machine-id (5): FIRST BOOT SEMANTICS
/etc/machine-id is used to decide whether a boot is the first one. The rules are as follows:
1. The kernel command argument systemd.condition_first_boot= may be used to override the autodetection logic, see
kernel-command-line(7).
2. Otherwise, if /etc/machine-id does not exist, this is a first boot. During early boot, systemd will write
"uninitialized\n" to this file and overmount a temporary file which contains the actual machine ID. Later
(after first-boot-complete.target has been reached), the real machine ID will be written to disk.
3. If /etc/machine-id contains the string "uninitialized", a boot is also considered the first boot. The same
mechanism as above applies.
4. If /etc/machine-id exists and is empty, a boot is not considered the first boot. systemd will still bind-mount
a file containing the actual machine-id over it and later try to commit it to disk (if /etc/ is writable).
5. If /etc/machine-id already contains a valid machine-id, this is not a first boot.
If according to the above rules a first boot is detected, units with ConditionFirstBoot=yes will be run and systemd
will perform additional initialization steps, in particular presetting units. seems to be in step 4 that the tmpfs bind mount is created. if you manually after this the i see the if you've tried to do |
Seems this was just changed in nixpkgs There is also this generator for disk images here: that manually writes the file without systemd. not sure which direction this should go |
I tried looking at where |
Bug description
/etc/machine-id is on tmpfs via etc-machine\x2did.mount unit.
this causes a new machine-id to be created each boot.
Various issues will transpire because of this:
journald
journald writes its logs to
/var/log/$(cat /etc/machine-id)
when vacuuming it will only consider those journals.
If you configure
SystemMaxUse=200M
in/etc/systemd/journald.conf
it will only vacuum the current boot logs leading to growing /var/log/journaljournalctl --list-boots
will only show the current boot.To Reproduce
Steps to reproduce the behavior:
cat /etc/machine-id
reboot
cat /etc/machine-id
WSL version
The text was updated successfully, but these errors were encountered: