From fab1f109d0564b44c950055d3233d6e7a1f3be81 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 23 Feb 2023 02:26:36 +1000 Subject: Add yet another timeout watchdog. --- update_apt-panopticon | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'update_apt-panopticon') diff --git a/update_apt-panopticon b/update_apt-panopticon index 8edb43d..abbc154 100755 --- a/update_apt-panopticon +++ b/update_apt-panopticon @@ -14,18 +14,26 @@ fi # Check if the lock file still exists. if [ -f apt-panopticon.lock ] ; then # Check if it's still running. - ps ax -eo pid,args | grep "luajit ./apt-panopticon.lua" | grep -v "grep luajit ./apt-panopticon.lua" | while read line ; do touch apt-panopticon.running ; exit ; done + ps ax -eo pid,args | grep "apt-panopticon.lua" | grep -v "grep apt-panopticon.lua" | while read line ; do touch apt-panopticon.running ; exit ; done if [ -f apt-panopticon.running ] ; then echo "Previous apt-panopticon still running, exiting." + echo "Previous apt-panopticon still running, exiting." + ./laggers rm apt-panopticon.running exit 1 fi echo "Crashed apt-panopticon detected, removing stale lock file." + echo "Crashed apt-panopticon detected, removing stale lock file." + ./laggers rm apt-panopticon.lock fi rm ../results; ln -s apt-panopticon/results_old ../results -flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock +flock -n apt-panopticon.lock ionice -c3 nice -n 19 timeout --kill-after=20.0 --foreground -v 8.5m ./apt-panopticon.lua && rm apt-panopticon.lock +if [ -f apt-panopticon.lock ] ; then + echo "apt-panopticon timed out." + ./laggers +fi rm ../results; ln -s apt-panopticon/results ../results chown -R www-data:www-data * -- cgit v1.1