From fee291a474f48e0b4b2f02c71950bc40348b2091 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 5 Aug 2025 09:51:18 +0000 Subject: [PATCH] exoscale: Run the cloud initialization process only once Signed-off-by: Michael Tremer --- src/initscripts/helper/exoscale-setup | 5 +++++ src/initscripts/system/cloud-init | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/initscripts/helper/exoscale-setup b/src/initscripts/helper/exoscale-setup index a0475c2bb..c8d5bd412 100644 --- a/src/initscripts/helper/exoscale-setup +++ b/src/initscripts/helper/exoscale-setup @@ -209,6 +209,11 @@ import_exoscale_configuration() { touch /var/ipfire/main/firstsetup_ok fi + # Run this all only once. The Exoscale metadata service does not + # give us a lot of information, so users are quite likely to make + # changes which should not be overwritten. + : > /var/ipfire/main/.cloud-init-done + # All done echo_ok } diff --git a/src/initscripts/system/cloud-init b/src/initscripts/system/cloud-init index 7721b5b8c..8b2ebbb5a 100644 --- a/src/initscripts/system/cloud-init +++ b/src/initscripts/system/cloud-init @@ -24,6 +24,11 @@ case "${1}" in start) + # Do nothing if this process has already been completed + if [ -e "/var/ipfire/main/.cloud-init-done" ]; then + exit 0 + fi + # Check if we are running in the cloud if running_on_ec2; then scriptname="/etc/rc.d/helper/aws-setup" -- 2.47.2