aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/update_apt-panopticon
diff options
context:
space:
mode:
authoronefang2023-02-23 02:26:36 +1000
committeronefang2023-02-23 02:26:36 +1000
commitfab1f109d0564b44c950055d3233d6e7a1f3be81 (patch)
treea002b3509041e8d5c140bc208b6496bc5fa4e7f4 /update_apt-panopticon
parentUpdate base files reference package. (diff)
downloadapt-panopticon-fab1f109d0564b44c950055d3233d6e7a1f3be81.zip
apt-panopticon-fab1f109d0564b44c950055d3233d6e7a1f3be81.tar.gz
apt-panopticon-fab1f109d0564b44c950055d3233d6e7a1f3be81.tar.bz2
apt-panopticon-fab1f109d0564b44c950055d3233d6e7a1f3be81.tar.xz
Add yet another timeout watchdog.
Diffstat (limited to '')
-rwxr-xr-xupdate_apt-panopticon12
1 files changed, 10 insertions, 2 deletions
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
14# Check if the lock file still exists. 14# Check if the lock file still exists.
15if [ -f apt-panopticon.lock ] ; then 15if [ -f apt-panopticon.lock ] ; then
16 # Check if it's still running. 16 # Check if it's still running.
17 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 17 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
18 if [ -f apt-panopticon.running ] ; then 18 if [ -f apt-panopticon.running ] ; then
19 echo "Previous apt-panopticon still running, exiting." 19 echo "Previous apt-panopticon still running, exiting."
20 echo "Previous apt-panopticon still running, exiting."
21 ./laggers
20 rm apt-panopticon.running 22 rm apt-panopticon.running
21 exit 1 23 exit 1
22 fi 24 fi
23 echo "Crashed apt-panopticon detected, removing stale lock file." 25 echo "Crashed apt-panopticon detected, removing stale lock file."
26 echo "Crashed apt-panopticon detected, removing stale lock file."
27 ./laggers
24 rm apt-panopticon.lock 28 rm apt-panopticon.lock
25fi 29fi
26 30
27rm ../results; ln -s apt-panopticon/results_old ../results 31rm ../results; ln -s apt-panopticon/results_old ../results
28flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock 32flock -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
33if [ -f apt-panopticon.lock ] ; then
34 echo "apt-panopticon timed out."
35 ./laggers
36fi
29rm ../results; ln -s apt-panopticon/results ../results 37rm ../results; ln -s apt-panopticon/results ../results
30 38
31chown -R www-data:www-data * 39chown -R www-data:www-data *