From 035d3b49bf4c227669d14f30165d322cdf8df92f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 14 Apr 2024 17:42:47 -0700 Subject: [PATCH] nextcloud: Pull the image separately before starting systemd unit This prevents timeout of the service if the image pull is slow. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/action_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/action_utils.py b/plinth/action_utils.py index 61783f21a..c4b338e56 100644 --- a/plinth/action_utils.py +++ b/plinth/action_utils.py @@ -505,6 +505,10 @@ def podman_create(container_name: str, image_name: str, volume_name: str, directory = pathlib.Path('/etc/containers/systemd') directory.mkdir(parents=True, exist_ok=True) + # Fetch the image before creating the container. The systemd service for + # the container won't timeout due to slow internet connectivity. + subprocess.run(['podman', 'image', 'pull', image_name], check=True) + pathlib.Path(volume_path).mkdir(parents=True, exist_ok=True) # Create storage volume volume_file = directory / f'{volume_name}.volume'