Skip to content

[202411] Stop the hwclock service and timer files before updating CMOS time #3853

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

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

saiarcot895
Copy link
Contributor

@saiarcot895 saiarcot895 commented Apr 14, 2025

What I did

When rebooting or doing a warm/fast reboot, stop the hwclock service and timer files before running hwclock -w. This removes the chance of a race condition where both of them run at the same time, causing one of them to fail.

Fixes sonic-net/sonic-buildimage#22230

How I did it

How to verify it

This is a race condition, and as such, may require a couple hundred reboot attempts to occur. With the fix, it's expected that this race condition will not occur at all.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

When rebooting or doing a warm/fast reboot, stop the hwclock service and
timer files before running `hwclock -w`. This removes the chance of a
race condition where both of them run at the same time, causing one of
them to fail.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@saiarcot895 saiarcot895 requested review from yxieca and vaibhavhd April 23, 2025 23:09
@yxieca
Copy link
Contributor

yxieca commented Apr 24, 2025

@saiarcot895 why do we not need this fix in master branch?

@saiarcot895
Copy link
Contributor Author

@yxieca This change (of having the hwclock service and timer files) is not present in the master branch because Chrony is handling the RTC.

@yxieca yxieca merged commit e6fb8f9 into sonic-net:202411 Apr 28, 2025
7 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