[hostcfgd] avoid in place editing config file contents#3904
Merged
yxieca merged 1 commit intosonic-net:masterfrom Dec 14, 2019
Merged
[hostcfgd] avoid in place editing config file contents#3904yxieca merged 1 commit intosonic-net:masterfrom
yxieca merged 1 commit intosonic-net:masterfrom
Conversation
In place editing (sed -i) seems having some issues with filesystem interaction. It could leave 0 size file or corrupted file behind. It would be safer to sed the file contents into a new file and switch new file with the old file. Signed-off-by: Ying Xie <[email protected]>
jleveque
approved these changes
Dec 13, 2019
Contributor
Author
|
retest vs please |
yxieca
added a commit
that referenced
this pull request
Dec 14, 2019
In place editing (sed -i) seems having some issues with filesystem interaction. It could leave 0 size file or corrupted file behind. It would be safer to sed the file contents into a new file and switch new file with the old file. Signed-off-by: Ying Xie <[email protected]>
abdosi
pushed a commit
that referenced
this pull request
Jan 3, 2020
In place editing (sed -i) seems having some issues with filesystem interaction. It could leave 0 size file or corrupted file behind. It would be safer to sed the file contents into a new file and switch new file with the old file. Signed-off-by: Ying Xie <[email protected]>
mssonicbld
added a commit
that referenced
this pull request
Jun 6, 2025
…atically (#22866) #### Why I did it src/sonic-utilities ``` * 3e61eb58 - (HEAD -> 202505, origin/202505) [smartswitch] Fix incorrect reboot status check and improve debug logging in reboot scripts (#3904) (18 hours ago) [mssonicbld] * 0584975c - [build] Update Azure pipeline to use Ubuntu 24.04 image (#3907) (18 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
In place editing (sed -i) seems having some issues with filesystem
interaction. It could leave 0 size file or corrupted file behind.
It would be safer to sed the file contents into a new file and switch
new file with the old file.
Signed-off-by: Ying Xie [email protected]
- How to verify it
The issue caused by lacking of this change is repeatable in every so many hundreds of warm reboots into new images. Not a high probability risk. Change had been tested by about 2000 iterations of warm reboots into new images.