From a4190754fe79542a36c2193d26f8ef15c636b7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 12 Mar 2025 20:07:26 +0100 Subject: [PATCH] Ensure haos-wipe service can be called only once per boot (#3924) In some cases, the wipe service may be called due to a race condition for the second time during the boot, very likely failing because the filesystems are already mounted. This can not be reproduced on OVA but can be fairly easy triggered e.g. on RPi. As we want the service to be executed exactly only once, we can do what's suggested in [1] and set the RemainAfterExit=yes. That should ensure the unit is not ever started for the second time. [1] https://www.github.com/systemd/systemd/issues/29367 (cherry picked from commit 24640c11aeb89290f7a1ecfd0c8c6527f8523e27) --- .../rootfs-overlay/usr/lib/systemd/system/haos-wipe.service | 1 + 1 file changed, 1 insertion(+) diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-wipe.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-wipe.service index c15119f53..4aca55a49 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-wipe.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-wipe.service @@ -10,6 +10,7 @@ ConditionKernelCommandLine=haos.wipe=1 [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/libexec/haos-wipe [Install]