-
Notifications
You must be signed in to change notification settings - Fork 15
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
auto-provisioning: improve behavior with power cuts #217
Conversation
Hey @jsrc27! Something like:
|
Related to @EdTheBearded's comment on making the whole operation generally more robust, another approach we could consider is relying on the atomicity of the rename operation. Basically, we could simply create a new version of the In practice this would probably mean just rewriting
An even more robust method would be to do the same with the whole |
@EdTheBearded Not sure if I fully understood your feedback. I have some questions for clarification. First of all did you mean Also did you mean to suggest adding this logic to |
Yeah, I meant No, I meant on But as @rborn-tx suggested, maybe doing all this in a .tmp folder and as a last step renaming it is a bit cleaner. |
I don't think that would ever realistically be the case no? The For So we'd be checking for the case where It would make sense if we want to do the hash verification after we unzip just for extra robustness I guess. |
Or we download But either way, @rborn-tx suggestion makes more sense. |
b7e59ab
to
46ceffb
Compare
V2 submitted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raising some other points.
recipes-sota/auto-provisioning/auto-provisioning/auto-provisioning.sh
Outdated
Show resolved
Hide resolved
V3 submitted |
@jsrc27 Would you like to update the commit message before merging this? |
Some users when auto-provisioning, power down the system once they see the auto-provisioning service exit successfully. However, in some cases this can cause the files created from the provisioning process to not be fully written to disk, resulting in 0-byte files upon next boot. Therefore, add some explicit syncs to improve this behavior. Also make use of a temp directory to improve the overall atomicity of the process. Related-to: TOR-3743 Signed-off-by: Jeremias Cordoba <[email protected]>
Commit message updated |
Some users when auto-provisioning, power down the system once they see the auto-provisioning service exit successfully. However, in some cases this can cause the files created from the provisioning process to not be fully written to disk, resulting in 0-byte files upon next boot.
Therefore, add an explicit sync after the files are written to improve the behavior of the auto-provisioning in these cases.
Related-to: TOR-3743