diff mbox series

[v2] osstest: stop anacron service

Message ID 20220407095104.39545-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series [v2] osstest: stop anacron service | expand

Commit Message

Roger Pau Monné April 7, 2022, 9:51 a.m. UTC
Just disabling cron in rc.d is not enough. There's also anacron which
will get invoked during startup, and since apt-compat has a delay of
up to 30min it can be picked up by the leak detector if the test
finishes fast enough:

LEAKED [process 14563 sleep] process: root     14563 14556  0 07:49 ?        00:00:00 sleep 1163
LEAKED [process 14550 /bin/sh] process: root     14550  2264  0 07:49 ?        00:00:00 /bin/sh -c run-parts --report /etc/cron.daily
LEAKED [process 14551 run-parts] process: root     14551 14550  0 07:49 ?        00:00:00 run-parts --report /etc/cron.daily
LEAKED [process 14556 /bin/sh] process: root     14556 14551  0 07:49 ?        00:00:00 /bin/sh /etc/cron.daily/apt-compat

From:

http://logs.test-lab.xenproject.org/osstest/logs/169015

To prevent this disable anacron like it's done for cron.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - Don't fail if the service is not present.
---
 Osstest/TestSupport.pm | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ian Jackson April 7, 2022, 1:54 p.m. UTC | #1
Roger Pau Monne writes ("[PATCH v2] osstest: stop anacron service"):
> Just disabling cron in rc.d is not enough. There's also anacron which
> will get invoked during startup, and since apt-compat has a delay of
> up to 30min it can be picked up by the leak detector if the test
> finishes fast enough:

Well done for tracking that down.

Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>

Ian.
diff mbox series

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 8103ea1d..156cac79 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -3151,6 +3151,11 @@  sub host_install_postboot_complete ($) {
     target_core_dump_setup($ho);
     target_cmd_root($ho, "update-rc.d cron disable");
     target_cmd_root($ho, "service cron stop");
+    # Anacron is installed as a dependency for task-laptop which is only
+    # installed on bare metal.  Don't error if the service is not present
+    # or else nested virt setup will fail.
+    target_cmd_root($ho, "update-rc.d anacron disable || true");
+    target_cmd_root($ho, "service anacron stop || true");
     target_cmd_root($ho, "update-rc.d osstest-confirm-booted start 99 2 .");
     target_https_mitm_proxy_setup($ho);
 }