Skip to content

systemd: prevent no rotation by human mistake#359

Open
mikhailnov wants to merge 1 commit intoAtoptool:masterfrom
mikhailnov:prevent-disk-full
Open

systemd: prevent no rotation by human mistake#359
mikhailnov wants to merge 1 commit intoAtoptool:masterfrom
mikhailnov:prevent-disk-full

Conversation

@mikhailnov
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant