From 540d7abd88afa7f64ae9e7ff01564644b1a3be64 Mon Sep 17 00:00:00 2001 From: NekoB0x <80163473+NekoB0x@users.noreply.github.com> Date: Thu, 25 Mar 2021 01:02:23 +0200 Subject: [PATCH 1/2] Fix redundant log writing Fixes calling "armbian-ramlog write" twice on systems with logrotate systemd unit. --- packages/bsp/common/etc/cron.daily/armbian-ram-logging | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/bsp/common/etc/cron.daily/armbian-ram-logging b/packages/bsp/common/etc/cron.daily/armbian-ram-logging index 95188cdbd3..500b060269 100755 --- a/packages/bsp/common/etc/cron.daily/armbian-ram-logging +++ b/packages/bsp/common/etc/cron.daily/armbian-ram-logging @@ -1,2 +1,6 @@ #!/bin/sh +# Only run on systems where logrotate is a cron job +if [ -f /lib/systemd/system/logrotate.timer ]; then + exit 0 +fi /usr/lib/armbian/armbian-ramlog write >/dev/null 2>&1 From 8b063ca8a610bf1be07ae4a123ecabfb1dde1461 Mon Sep 17 00:00:00 2001 From: NekoB0x <80163473+NekoB0x@users.noreply.github.com> Date: Thu, 25 Mar 2021 11:19:35 +0200 Subject: [PATCH 2/2] Update armbian-ram-logging --- packages/bsp/common/etc/cron.daily/armbian-ram-logging | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/bsp/common/etc/cron.daily/armbian-ram-logging b/packages/bsp/common/etc/cron.daily/armbian-ram-logging index 500b060269..cea8d5a79f 100755 --- a/packages/bsp/common/etc/cron.daily/armbian-ram-logging +++ b/packages/bsp/common/etc/cron.daily/armbian-ram-logging @@ -1,6 +1,4 @@ #!/bin/sh # Only run on systems where logrotate is a cron job -if [ -f /lib/systemd/system/logrotate.timer ]; then - exit 0 -fi +systemctl is-active --quiet logrotate.timer && exit 0 /usr/lib/armbian/armbian-ramlog write >/dev/null 2>&1