[v5,1/6] expand-on-first-boot: really only do that once, especially on failure

Message ID 20221215142759.26327-2-henning.schild@siemens.com
State Superseded, archived
Headers show
Series [v5,1/6] expand-on-first-boot: really only do that once, especially on failure | expand

Commit Message

Henning Schild Dec. 15, 2022, 2:27 p.m. UTC
From: Henning Schild <henning.schild@siemens.com>

We do hope the expand will work but we also know very well that it can
fail. The script is written in a way that currently only supports one
try. And not a retry if it failed in an earlier boot.
So make sure to disable the service also on failure.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 .../expand-on-first-boot/files/expand-on-first-boot.service      | 1 +
 1 file changed, 1 insertion(+)

Comments

Roberto A. Foglietta Dec. 15, 2022, 3:32 p.m. UTC | #1
On Thu, 15 Dec 2022 at 15:28, <henning.schild@siemens.com> wrote:
>
> From: Henning Schild <henning.schild@siemens.com>
>
> We do hope the expand will work but we also know very well that it can
> fail. The script is written in a way that currently only supports one
> try. And not a retry if it failed in an earlier boot.
> So make sure to disable the service also on failure.

Disabling the expansion of last partition service at the first failure:

- decreases the chance that the human operator will notice the failure
in the boot logs and thus create a barrier to investigate that failure
and/or report it promptly.

- it is not compatible with the case of an unsupervised embedded
system that should not be able to go in service unless it is provided
with the full storage space.

- does not solve any real problem but just masquerading any related
issue and limits the options above.

My suggestion is to not apply this patch. I did a test and without
this patch the service continues to be active unless it completes
successfully.

I hope this helps, R-

Patch

diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
index fda50016e9fe..90c92a396b27 100644
--- a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
@@ -15,6 +15,7 @@  ConditionPathIsReadWrite=/etc
 Type=oneshot
 ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
 ExecStartPost=-/bin/systemctl disable expand-on-first-boot.service
+ExecStopPost=-/bin/systemctl disable expand-on-first-boot.service
 
 [Install]
 WantedBy=sysinit.target