mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
[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.
This commit is contained in:
parent
44d6d5784c
commit
e9bb483fb8
1 changed files with 2 additions and 0 deletions
|
@ -194,6 +194,8 @@ var lxcHelpers string
|
||||||
|
|
||||||
var startTemplate = template.Must(template.New("start").Parse(`#!/bin/bash -e
|
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_CONFIG="{{.Config}}"
|
||||||
LXC_CONTAINER_RELEASE="{{.Release}}"
|
LXC_CONTAINER_RELEASE="{{.Release}}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue