aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/update_apt-panopticon
diff options
context:
space:
mode:
Diffstat (limited to 'update_apt-panopticon')
-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 *