Commit 61a9d7e
Adding fix to clear logs before reboot for disk out of space issue (sonic-net#20323)
What is the motivation for this PR?
To proactively prevent disk space issues by cleaning up unnecessary log files in /host/logs_before_reboot during the disk space freeing step. This is especially useful before upgrades, where disk space can be a concern.
How did you do it?
Added the following line to the disk cleanup routine (typically found in the free_up_disk_space function):
exec_command(module, "rm -rf /host/logs_before_reboot/*", ignore_error=True)
This line is placed with other similar cleanup commands for logs, cores, dumps, etc.
How did you verify/test it?
Tested the updated cleanup routine in a testbed and verified that files in /host/logs_before_reboot are deleted as expected. Confirmed that the upgrade process proceeds with sufficient disk space and no residual log files.
Any platform specific information?
No platform-specific changes. This cleanup is safe for all platforms supported by SONiC testbed.
Supported testbed topology if it's a new test case?
Not a new test case. This is a framework/testbed maintenance improvement.
Documentation
No specific documentation updates are required for this change, as it is a maintenance step within the existing disk cleanup routine.1 parent d8b69d9 commit 61a9d7e
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
0 commit comments