From 4af1aa670b532f00cd7babda0dfe0fcb90bcfd1a Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 18 Feb 2021 16:26:11 -0600 Subject: [PATCH] replace pkill loop with pgrep while loop --- lxc/execute | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lxc/execute b/lxc/execute index 66e1daf..3f893fb 100755 --- a/lxc/execute +++ b/lxc/execute @@ -27,7 +27,7 @@ exec 200>&- # prevent users from spying on each other lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " + /bin/bash -c " chown runner$runner: -R /tmp/$id chmod 700 /tmp/$id " > /dev/null 2>&1 @@ -35,12 +35,12 @@ lxc-attach --clear-env -n piston -- \ # runner timeout -s KILL 20 \ 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 lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " - for i in {1..100} + /bin/bash -c " + while pgrep -u runner$runner > /dev/null do pkill -u runner$runner --signal SIGKILL done