[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
d0f60d6ac2
commit
251cc1c26d
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…
Reference in a new issue