From 0ea789571bef04073ee88c98c3860e16996a0d76 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 25 Jul 2017 15:59:47 +0200 Subject: [PATCH] Fix the dataminer algorithms updater script: it searched the lock file in the wrong place. --- smartgears/dataminer_app/tasks/dataminer-app.yml | 2 +- smartgears/dataminer_app/templates/algorithms-updater.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index 268e64e6..a50d278d 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -22,7 +22,7 @@ tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ] - name: Cron job that updates the algorithms repository and adds the missing algorithms configurations - cron: name="SVN update the algorithms repository" minute="*/10" job="/usr/local/bin/algorithms-updater" user='{{ smartgears_user }}' state=present + cron: name="SVN update the algorithms repository" minute="*/10" job="/usr/local/bin/algorithms-updater > {{ smartgears_instance_path }}/wps_algorithms_install_log/algorithms_updater_cron.log 2>&1" user='{{ smartgears_user }}' state=present tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms' ] - name: Create a directory where to install the gebco_08.nc data file diff --git a/smartgears/dataminer_app/templates/algorithms-updater.j2 b/smartgears/dataminer_app/templates/algorithms-updater.j2 index a53aa5de..e0442262 100644 --- a/smartgears/dataminer_app/templates/algorithms-updater.j2 +++ b/smartgears/dataminer_app/templates/algorithms-updater.j2 @@ -36,7 +36,7 @@ function check_lock_file() { if [ -f $LOCK_FILE ] ; then set +o pipefail set +e - RUNNING_JOB=$( ps auwwx | grep `cat /tmp/io` | grep -v grep ) + RUNNING_JOB=$( ps auwwx | grep `cat $LOCK_FILE` | grep -v grep ) RUNNING_JOB_RETVAL=$? if [ $RUNNING_JOB_RETVAL -eq 0 ] ; then logger 'algorithms-updater: another job still running, exiting.'