patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: "Demi Marie Obenour" <demiobenour@gmail.com>,
	"Johannes Süllner" <johannes.suellner@mailbox.org>
Subject: [PATCH v2 2/2] vm/app/systemd-sysupdate: retry a few times
Date: Mon,  8 Dec 2025 22:03:17 +0100	[thread overview]
Message-ID: <20251208210416.426243-4-hi@alyssa.is> (raw)
In-Reply-To: <20251208210416.426243-2-hi@alyssa.is>

It takes time for the network to come up, so it's likely that the
download will fail immediately after the VM boots.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
v2: unchanged
v1: https://spectrum-os.org/lists/archives/spectrum-devel/20251208162526.319756-2-hi@alyssa.is/

 vm/app/systemd-sysupdate/download-update | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vm/app/systemd-sysupdate/download-update b/vm/app/systemd-sysupdate/download-update
index f8f5aed..32a078f 100755
--- a/vm/app/systemd-sysupdate/download-update
+++ b/vm/app/systemd-sysupdate/download-update
@@ -1,5 +1,6 @@
 #!/usr/bin/env -S execlineb -WS0
 # SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
 # SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
 export LC_ALL C
 export LANGUAGE C
@@ -59,7 +60,12 @@ multisubstitute {
   importas -iuS SYSTEMD_SYSUPDATE_PATH
   importas -iuS tmpdir
 }
-if { $SYSTEMD_SYSUPDATE_PATH --definitions=${tmpdir} update }
+if {
+  forx -x 0 _ { 1 2 3 4 5 }
+  if -nt { $SYSTEMD_SYSUPDATE_PATH --definitions=${tmpdir} update }
+  foreground { sleep 1 }
+  exit 1
+}
 # [ and ] are allowed in update URLs so that IPv6 addresses work, but
 # they cause globbing in the curl command-line tool by default.  Use --globoff
 # to disable this feature.
-- 
2.51.0


  reply	other threads:[~2025-12-08 21:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 21:03 [PATCH v2 1/2] vm/app/systemd-sysupdate: fix mounting overlay Alyssa Ross
2025-12-08 21:03 ` Alyssa Ross [this message]
2025-12-09 10:19   ` [PATCH v2 2/2] vm/app/systemd-sysupdate: retry a few times Alyssa Ross
2025-12-09 10:19 ` [PATCH v2 1/2] vm/app/systemd-sysupdate: fix mounting overlay Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251208210416.426243-4-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=johannes.suellner@mailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).