systemd: prevent no rotation by human mistake#359
Open
mikhailnov wants to merge 1 commit intoAtoptool:masterfrom
Open
systemd: prevent no rotation by human mistake#359mikhailnov wants to merge 1 commit intoAtoptool:masterfrom
mikhailnov wants to merge 1 commit intoAtoptool:masterfrom
Conversation
We in ROSA Linux have policy to not enable systemd units automatically after package installation. In some cases we do enable them, but it does not seem to make sense for atop. It is not obvious, which units must be enabled. A user from a big company enabled only atop.service and logs were not rotated, disk could become full. To avoid such human mistakes, I suggest to automatically start rotation when atop.service is started. I added "Wanted=atop-rotate.timer" into atop.service. Now atop-rotate.timer is automatically started with atop.service. atop-rotate.timer remains active after "systemctl stop atop.service" and would start it again automatically, so I changed "systemctl restart atop" to "systemctl try-restart atop" in atop-rotate.service. Commit 6180aba previously changed "try-restart" to "restart", but I did not understand why it can be "already exited". (@ShirleyFei, maybe you can comment?). To my mind, if it was stopped manually, it should not start back automatically.
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.
We in ROSA Linux have policy to not enable systemd units automatically after package installation. In some cases we do enable them, but it does not seem to make sense for atop.
It is not obvious, which units must be enabled.
A user from a big company enabled only atop.service and logs were not rotated, disk could become full.
To avoid such human mistakes, I suggest to automatically start rotation when atop.service is started.
I added "Wanted=atop-rotate.timer" into atop.service. Now atop-rotate.timer is automatically started with atop.service. atop-rotate.timer remains active after "systemctl stop atop.service" and would start it again automatically, so I changed "systemctl restart atop" to "systemctl try-restart atop" in atop-rotate.service. Commit 6180aba previously changed "try-restart" to "restart", but I did not understand why it can be "already exited". (@ShirleyFei, maybe you can comment?).
To my mind, if it was stopped manually, it should not start back automatically.