diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-10 06:01:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 06:01:33 +0100 |
commit | deea1c6a2070276c0cd2f78bf0346c993773a900 (patch) | |
tree | 5ccb2bdb5f0de02748329992340fdb517681de9f /src/etc | |
parent | 552ab74b49a44b6cd830fbdc13d40d1633f3c6cf (diff) | |
parent | 14e3b26ff5ffce9ae19050645b0efc6c4725880a (diff) | |
download | vyos-1x-deea1c6a2070276c0cd2f78bf0346c993773a900.tar.gz vyos-1x-deea1c6a2070276c0cd2f78bf0346c993773a900.zip |
Merge pull request #1068 from zdc/T3774-sagitta
atop: T3774: Atop log file rotation fix
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/logrotate.d/vyos-atop | 20 | ||||
-rw-r--r-- | src/etc/systemd/system/atop.service.d/10-override.conf | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/etc/logrotate.d/vyos-atop b/src/etc/logrotate.d/vyos-atop new file mode 100644 index 000000000..0c8359c7b --- /dev/null +++ b/src/etc/logrotate.d/vyos-atop @@ -0,0 +1,20 @@ +/var/log/atop/atop.log { + daily + dateext + dateformat _%Y-%m-%d_%H-%M-%S + maxsize 10M + missingok + nocompress + nocreate + nomail + rotate 10 + prerotate + # stop the service + systemctl stop atop.service + endscript + postrotate + # start atop service again + systemctl start atop.service + endscript +} + diff --git a/src/etc/systemd/system/atop.service.d/10-override.conf b/src/etc/systemd/system/atop.service.d/10-override.conf new file mode 100644 index 000000000..10df15862 --- /dev/null +++ b/src/etc/systemd/system/atop.service.d/10-override.conf @@ -0,0 +1,6 @@ +[Service] +ExecStartPre= +ExecStart= +ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop.log" ${LOGINTERVAL}' +ExecStartPost= + |