diff options
Diffstat (limited to '')
-rwxr-xr-x | update_apt-panopticon | 12 |
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. |
15 | if [ -f apt-panopticon.lock ] ; then | 15 | if [ -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 |
25 | fi | 29 | fi |
26 | 30 | ||
27 | rm ../results; ln -s apt-panopticon/results_old ../results | 31 | rm ../results; ln -s apt-panopticon/results_old ../results |
28 | flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock | 32 | 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 |
33 | if [ -f apt-panopticon.lock ] ; then | ||
34 | echo "apt-panopticon timed out." | ||
35 | ./laggers | ||
36 | fi | ||
29 | rm ../results; ln -s apt-panopticon/results ../results | 37 | rm ../results; ln -s apt-panopticon/results ../results |
30 | 38 | ||
31 | chown -R www-data:www-data * | 39 | chown -R www-data:www-data * |