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

bootupctl: Clear failure status from previous runs #715

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

travier
Copy link
Member

@travier travier commented Sep 2, 2024

If for whatever reason a bootupd command fails, it will leave the
systemd service unit in a failed state and systemd will then refuse to
run a unit under the same name with systemd-run again until the
failure is cleared.

Thus systematically call systemctl reset-failed before calling
systemd-run to clear any potential failures from previous calls.

Do not check the return code of the systemctl command on purpose as it
may fail if the unit does not exists yet, i.e. if no bootupctl command
has been run yet.

Also ignore stdout/stderr to avoid showing unexpected errors messages to
users.

See: #707
See: #663

@travier
Copy link
Member Author

travier commented Sep 2, 2024

This does not check the return code of the systemctl command on purpose as it may fail if the unit does not exists yet, i.e. if no bootupctl command has been run yet.

Maybe we should also completely ignore stdout/stderr for this command.

@cgwalters
Copy link
Member

Maybe we should also completely ignore stdout/stderr for this command.

This also sounds like a good idea.

If for whatever reason a bootupd command fails, it will leave the
systemd service unit in a failed state and systemd will then refuse to
run a unit under the same name with `systemd-run` again until the
failure is cleared.

Thus systematically call `systemctl reset-failed` before calling
`systemd-run` to clear any potential failures from previous calls.

Do not check the return code of the systemctl command on purpose as it
may fail if the unit does not exists yet, i.e. if no bootupctl command
has been run yet.

Also ignore stdout/stderr to avoid showing unexpected errors messages to
users.

See: coreos#707
See: coreos#663
@HuijingHei HuijingHei merged commit 0f3de09 into coreos:main Sep 3, 2024
12 checks passed
@travier travier deleted the main-systemctl-reset branch September 3, 2024 08:21
@travier travier mentioned this pull request Sep 16, 2024
41 tasks
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