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

generators: Don't write files other than unit files #84

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

pothos
Copy link
Member

@pothos pothos commented Jan 22, 2024

Systemd now executes generators in a sandbox to make sure they only generate units and don't have other side effects:
https://github.com/systemd/systemd/blob/166bcaf95fbdd036f99705d2204138c36eb95836/NEWS#L1583

Port our generator usage to comply with the new behavior so that we can
update our systemd version. Move the Ignition preparations into the
ignition-setup script, setup the fsck overwrite unit at install time,
and remove the mkdir calls because Mount units will do this when needed.

How to use

Testing done

see scripts PR

pothos added a commit to flatcar/scripts that referenced this pull request Jan 22, 2024
This pulls in flatcar/bootengine#84
to prepare for a systemd update.
Systemd now executes generators in a sandbox to make sure they only
generate units and don't have other side effects:
https://github.com/systemd/systemd/blob/166bcaf95fbdd036f99705d2204138c36eb95836/NEWS#L1583

Port our generator usage to comply with the new behavior so that we can
update our systemd version. Move the Ignition preparations into the
ignition-setup script, setup the fsck overwrite unit at install time,
and remove the mkdir calls because Mount units will do this when needed.
@pothos pothos force-pushed the kai/generator-cleanup branch from 7be7baa to dd8c70b Compare January 22, 2024 16:12
pothos added a commit to flatcar/scripts that referenced this pull request Jan 22, 2024
This pulls in flatcar/bootengine#84
to prepare for a systemd update.
@pothos pothos requested a review from a team January 22, 2024 22:49
Comment on lines +20 to +26
# Set up by 10usr-generator/module-setup.sh
[Unit]
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this should be kept more-or-less in sync with systemd - upstream seems to have more stuff in the unit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe we should carry a patch to systemd, so no overwriting needs to be done here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minimal unit, to have it start instead of masking it. What we would need upstream is a way of resetting the After= dependencies through a drop-in…

@pothos pothos requested a review from a team January 24, 2024 09:37
@pothos pothos merged commit 1034107 into flatcar-master Jan 24, 2024
@pothos pothos deleted the kai/generator-cleanup branch January 24, 2024 13:21
pothos added a commit to flatcar/scripts that referenced this pull request Jan 24, 2024
This pulls in flatcar/bootengine#84
to prepare for a systemd update.
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.

2 participants