replace pkill loop with pgrep while loop
This commit is contained in:
parent
4d344db148
commit
4af1aa670b
|
@ -27,7 +27,7 @@ exec 200>&-
|
||||||
|
|
||||||
# prevent users from spying on each other
|
# prevent users from spying on each other
|
||||||
lxc-attach --clear-env -n piston -- \
|
lxc-attach --clear-env -n piston -- \
|
||||||
/bin/bash -l -c "
|
/bin/bash -c "
|
||||||
chown runner$runner: -R /tmp/$id
|
chown runner$runner: -R /tmp/$id
|
||||||
chmod 700 /tmp/$id
|
chmod 700 /tmp/$id
|
||||||
" > /dev/null 2>&1
|
" > /dev/null 2>&1
|
||||||
|
@ -35,12 +35,12 @@ lxc-attach --clear-env -n piston -- \
|
||||||
# runner
|
# runner
|
||||||
timeout -s KILL 20 \
|
timeout -s KILL 20 \
|
||||||
lxc-attach --clear-env -n piston -- \
|
lxc-attach --clear-env -n piston -- \
|
||||||
/bin/bash -l -c "runuser runner$runner /exec/$language $id"
|
/bin/bash -c "runuser runner$runner /exec/$language $id"
|
||||||
|
|
||||||
# process janitor
|
# process janitor
|
||||||
lxc-attach --clear-env -n piston -- \
|
lxc-attach --clear-env -n piston -- \
|
||||||
/bin/bash -l -c "
|
/bin/bash -c "
|
||||||
for i in {1..100}
|
while pgrep -u runner$runner > /dev/null
|
||||||
do
|
do
|
||||||
pkill -u runner$runner --signal SIGKILL
|
pkill -u runner$runner --signal SIGKILL
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue