-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[armhf][Nokia-7215] changes fstrim.timer to daily #14723
Conversation
Additional reviewers @carl-nokia @mlok-nokia @Pavan-Nokia |
|
||
if [ -r /host/machine.conf ]; then | ||
# fstrim frequency to daily for our platform | ||
desc="Discard unused blocks ($platform)" |
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.
@jon-nokia where is 'desc' used?
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.
It's used in the sed command to change the description from "Discard unused blocks once a week". Since I was changing the OnCalendar value the description no longer made sense.
desc="Discard unused blocks ($platform)" | ||
sed -i -e "s,OnCalendar=.*,OnCalendar=daily,g" \ | ||
-e "s,Description=.*,Description=$desc,g" \ | ||
/usr/lib/systemd/system/fstrim.timer |
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.
Instead of modifying the packaged file, please create an override file for this timer, in /etc/systemd/system/fstrim.timer.d/
. This is far cleaner and less likely to break something in the case of some updates/changes.
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.
Will do. That is much cleaner. Thank you.
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.
Replaced original commit with this use of override.conf.
@@ -1,5 +1,6 @@ | |||
nokia-7215_plt_setup.sh usr/sbin | |||
7215/scripts/nokia-7215init.sh usr/local/bin | |||
7215/service/nokia-7215init.service etc/systemd/system | |||
7215/service/fstrim.timer/override.conf /etc/systemd/system/fstrim.timer.d |
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.
Ah, if installing in a package, it's better to have it be in /lib/systemd/system/fstrim.timer.d
. Also, I'd recommend naming it something besides override.conf
, in case there happens to be some conflict (which is unlikely).
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.
For /etc/systemd, I followed your example as well as that of the file, nokia-7215init.service. I'm not sure when to use /etc/systemd vs /lib/systemd and what the convention really is. Are you sure we need to change this?
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.
The /etc/systemd directory is meant for service files and overrides that are created by the system administrator. These are generally not installed through a package. The /lib/systemd directory are for service files that do come from a package. See this for a more detailed description.
I would recommend following the convention, at least for consistency. At the very least, since override.conf is a common name for service file overrides, and since this is coming from a package, I'd highly recommend renaming this file.
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.
@saiarcot895, Please check if the latest update is satisfactory. Thanks
Using timer-override.conf, we modify the fstrim.timer service. For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily instead of weekly. This is required because the size of the SSD on this platform is 16GB, which on average is nearly 10 times smaller than most other sonic platforms. With smaller disk and the ever increasing level of logging done by sonic, this change is required to prevent the SSD from entering a read-only state due to inadequate free blocks.
@jon-nokia have you tested this new change? |
Yes, I posted results in verification section for you just now. |
@lguohan please help merge this PR |
Using timer-override.conf, we modify the fstrim.timer service. For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily instead of weekly. This is required because the size of the SSD on this platform is 16GB, which on average is nearly 10 times smaller than most other sonic platforms. With smaller disk and the ever increasing level of logging done by sonic, this change is required to prevent the SSD from entering a read-only state due to inadequate free blocks.
Cherry-pick PR to 202012: #15015 |
Using timer-override.conf, we modify the fstrim.timer service. For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily instead of weekly. This is required because the size of the SSD on this platform is 16GB, which on average is nearly 10 times smaller than most other sonic platforms. With smaller disk and the ever increasing level of logging done by sonic, this change is required to prevent the SSD from entering a read-only state due to inadequate free blocks.
Using timer-override.conf, we modify the fstrim.timer service. For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily instead of weekly. This is required because the size of the SSD on this platform is 16GB, which on average is nearly 10 times smaller than most other sonic platforms. With smaller disk and the ever increasing level of logging done by sonic, this change is required to prevent the SSD from entering a read-only state due to inadequate free blocks.
Using timer-override.conf, we modify the fstrim.timer service. For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily instead of weekly. This is required because the size of the SSD on this platform is 16GB, which on average is nearly 10 times smaller than most other sonic platforms. With smaller disk and the ever increasing level of logging done by sonic, this change is required to prevent the SSD from entering a read-only state due to inadequate free blocks.
Cherry-pick PR to 202211: #15125 |
Cherry-pick PR to 202205: #15126 |
Using override.conf, we modify the fstrim.timer service.
For armhf, Nokia-7215 platform, we modify fstrim.timer to run daily
instead of weekly. This is required because the size of the SSD on
this platform is 16GB, which on average is nearly 10 times smaller than
most other sonic platforms. With smaller disk and the ever increasing
level of logging done by sonic, this change is required to prevent
the SSD from entering a read-only state due to inadequate free blocks.
Why I did it
Required to prevent the SSD from entering a read-only state due to inadequate free blocks
Work item tracking
How I did it
How to verify it
Verified that override works.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)