Skip to content

Commit f60380a

Browse files
committed
fix (#8)
1 parent a6d536d commit f60380a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

runners/lxc/lxc-execute.bash

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
dir="$( cd "$( dirname "$0" )" && pwd )"
44

55
id=$1
6+
containername=$2
67

78

89
touch $dir/lockfile
@@ -19,19 +20,19 @@ echo $runner > $dir/i
1920
exec 200>&-
2021

2122
# prevent users from spying on each other
22-
lxc-attach --clear-env -n cee -- \
23+
lxc-attach --clear-env -n $containername -- \
2324
/bin/bash -c "
2425
chown runner$runner: -R /tmp/$id
2526
chmod 700 /tmp/$id
2627
" > /dev/null 2>&1
2728

2829
# runner
2930
timeout -s KILL 20 \
30-
lxc-attach --clear-env -n cee -- \
31+
lxc-attach --clear-env -n $containername -- \
3132
/bin/bash -l -c "runuser runner$runner /tmp/$id/runner.sh /tmp/$id"
3233

3334

34-
lxc-attach --clear-env -n cee -- \
35+
lxc-attach --clear-env -n $containername -- \
3536
/bin/bash -c "
3637
while pgrep -u runner$runner > /dev/null
3738
do

src/lxc.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313

1414
class LXC {
1515
LXC_ROOT_FS: string;
16+
CONTAINER: string;
1617

1718
constructor(container: string) {
19+
this.CONTAINER = container;
1820
// Check OS
1921
const os = platform();
2022
if (os !== "linux") {
@@ -119,7 +121,7 @@ class LXC {
119121

120122
return new Promise<string>((resolve, reject) => {
121123
exec(
122-
`bash ${__dirname}/../runners/lxc/lxc-execute.bash ${id}`,
124+
`bash ${__dirname}/../runners/lxc/lxc-execute.bash ${id} ${this.CONTAINER}`,
123125
(err, stdout, stderr) => {
124126
if (err) return reject(err);
125127
if (stderr) return reject(stderr);

0 commit comments

Comments
 (0)