Skip to content
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

Include initrd mounts in the final system also #3

Closed
wants to merge 2 commits into from

Conversation

r-vdp
Copy link
Contributor

@r-vdp r-vdp commented Sep 9, 2024

Without this, things like RequiresMountsFor do not work correctly during shutdown.

See systemd/systemd#34327

Fixes #2

Without this, things like `RequiresMountsFor` do not work correctly
during shutdown.

See systemd/systemd#34327
@r-vdp r-vdp force-pushed the include-initrd-mounts-in-system branch from eb99962 to 3fae1ab Compare September 9, 2024 19:13
@WilliButz
Copy link
Owner

It seems like this change would re-introduce the ordering cycle for var-log.mount, systemd-journal-flush.service, and systemd-tmpfiles-setup.service (described in TODO.md).

Adding an entry in the integration test for /var/log with inInitrd=true should cause log messages about the ordering cycle to appear.

I'm not sure yet how to resolve this, other than the solution described at the end of the linked file.

@r-vdp
Copy link
Contributor Author

r-vdp commented Sep 9, 2024

I booted my system with this and didn't get any mention of a cycle in my logs.

@r-vdp
Copy link
Contributor Author

r-vdp commented Sep 9, 2024

The mount is still set up in initrd as before, it's just that we include the unit in the final system as well so that systemd takes it into account and uses the right ordering when unmounting.
Nothing gets remounted or such.

@WilliButz
Copy link
Owner

I booted my system with this and didn't get any mention of a cycle in my logs

I just pushed another branch based on yours where /var/log is also preserved in the test, here you can see the log messages that show the described ordering cycle:
https://github.com/WilliButz/preservation/actions/runs/10808159129/job/29980512998#step:5:1813

@r-vdp
Copy link
Contributor Author

r-vdp commented Sep 11, 2024

It's so weird that I don't have that cycle on my systems, I just checked again. I have the whole shutdown sequence in the logs and there's no mention of any cycle. I will try to find out what is different, something in my config must be preventing this cycle. I'm running nixos-unstable (with a bunch of unmerged PRs patched in).

I already notice that actually now there isn't any mention of unmounting /var/log or /var/lib on shutdown of my machine, neither of stopping systemd-journal-flush. They might only get unmounted after the journal already stopped, since the last message that I have is "Journal stopped".

@WilliButz
Copy link
Owner

This should be solved by 97104c0.
Now /var/log is also included in the test and it no longer needs inInitrd = true to avoid the ordering cycle.

@r-vdp
Copy link
Contributor Author

r-vdp commented Oct 28, 2024

Cool, I'll give that a try, thanks for your work on this!

@r-vdp
Copy link
Contributor Author

r-vdp commented Nov 2, 2024

Seems to be working well now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on shutdown unmounting /var/log
2 participants