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

Catch and ignore SIGTERM during update operations #812

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

cgwalters
Copy link
Member

Since our updates are non-transactional in general, we should at least be robust against some concurrent invocation of e.g. reboot.

Replaces: #811

@cgwalters
Copy link
Member Author

Copying the comment from #811

If we just ignore SIGTERM, we must set KillMode=mixed so that subprocess do not also get SIGTERM (https://www.freedesktop.org/software/systemd/man/latest/systemd.kill.html#KillMode=)

This is an interesting point; I was going to say we don't fork subprocesses but in fact we do.

Since our updates are non-transactional in general, we should
at least be robust against some concurrent invocation of e.g.
`reboot`.

Replaces: coreos#811
Signed-off-by: Colin Walters <walters@verbum.org>
Any child processes we fork are not long running, so they don't
need their own individual SIGTERM. Doing things this way ensures
that when we suppress SIGTERM for our process that's sufficient
to ensure the whole unit runs uninterrupted.

Signed-off-by: Colin Walters <walters@verbum.org>
src/cli/bootupctl.rs Outdated Show resolved Hide resolved
And add comments in both places so we remember
to keep them in sync.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters requested a review from HuijingHei January 9, 2025 12:27
Copy link
Member

@HuijingHei HuijingHei left a comment

Choose a reason for hiding this comment

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

Overall LGTM

@HuijingHei HuijingHei merged commit bde9faf into coreos:main Jan 9, 2025
12 checks passed
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.

3 participants