Skip to content

bootupctl: Clear failure status from previous runs - #715

Merged
HuijingHei merged 1 commit into
coreos:mainfrom
travier:main-systemctl-reset
Sep 3, 2024
Merged

bootupctl: Clear failure status from previous runs#715
HuijingHei merged 1 commit into
coreos:mainfrom
travier:main-systemctl-reset

Conversation

@travier

@travier travier commented Sep 2, 2024

Copy link
Copy Markdown
Member

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
travier force-pushed the main-systemctl-reset branch from 593c2aa to 5775985 Compare September 2, 2024 15:20
@travier
travier requested a review from HuijingHei September 2, 2024 16:11
@travier

travier commented Sep 2, 2024

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
@travier
travier force-pushed the main-systemctl-reset branch from 5775985 to 6fcc010 Compare September 2, 2024 21:52
@HuijingHei
HuijingHei merged commit 0f3de09 into coreos:main Sep 3, 2024
@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