From e9bb483fb8251cac19b97b17a7f5c3a9d5086069 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 11 Nov 2023 11:21:05 +0100 Subject: [PATCH] [LXC] global lock on start Since the start script may create LXC templates that are shared, they may race against each other when running for the first time. A lock global to the host needs to be used to guarantee that does not happen. --- act/runner/run_context.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index d273fd2a..1f0924fc 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -194,6 +194,8 @@ var lxcHelpers string var startTemplate = template.Must(template.New("start").Parse(`#!/bin/bash -e +exec 5<>/tmp/forgejo-runner-lxc.lock ; flock --timeout 21600 5 + LXC_CONTAINER_CONFIG="{{.Config}}" LXC_CONTAINER_RELEASE="{{.Release}}"