Skip to content

Commit

Permalink
Merge pull request #139 from tmaeno/master
Browse files Browse the repository at this point in the history
Moved lock/pid files out of log dir
  • Loading branch information
tmaeno authored Jul 25, 2022
2 parents 7292942 + d36aab4 commit fd9b0ba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ RUN chmod -R 777 /etc/grid-security/certificates
RUN chmod -R 777 /data/harvester
RUN chmod -R 777 /data/condor

# make lock dir
ENV PANDA_LOCK_DIR /var/run/panda
RUN mkdir -p ${PANDA_LOCK_DIR} && chmod 777 ${PANDA_LOCK_DIR}

# make a wrapper script to launch services and periodic jobs in non-root container
RUN echo $'#!/bin/bash \n\
set -m \n\
Expand Down
5 changes: 4 additions & 1 deletion pandaharvester/harvesterbody/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
from pandalogger import logger_config

logDir = logger_config.daemon['logdir']
lockFileName = os.path.join(logDir, 'watcher.lock')
if 'PANDA_LOCK_DIR' in os.environ:
lockFileName = os.path.join('PANDA_LOCK_DIR', 'watcher.lock')
else:
lockFileName = os.path.join(logDir, 'watcher.lock')

# logger
_logger = core_utils.setup_logger('watcher')
Expand Down
2 changes: 1 addition & 1 deletion pandaharvester/panda_pkg_info.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "0.2.13"
release_version = "0.2.14"
12 changes: 8 additions & 4 deletions templates/init.d/panda_harvester-uwsgi.rpmnew.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ VIRTUAL_ENV=/opt/harvester
# FIXME
LOG_DIR=/var/log/panda

# pid and lock files
PIDFILE=${LOG_DIR}/panda_harvester.pid
# pid and local info files
if [[ -z "${PANDA_LOCK_DIR}" ]]; then
PIDFILE=${LOG_DIR}/panda_harvester.pid
LOCAL_INFO_FILE=${LOG_DIR}/.harvester_info
else
PIDFILE=${PANDA_LOCK_DIR}/panda_harvester.pid
LOCAL_INFO_FILE=${PANDA_LOCK_DIR}/.harvester_info
fi

# log files
HSTDOUT=${LOG_DIR}/panda_harvester_stdout.log
HSTDERR=${LOG_DIR}/panda_harvester_stderr.log

# harvester local info file
LOCAL_INFO_FILE=${LOG_DIR}/.harvester_info

# check interval in second and max number of check attempts of process handle
checkInterval=1
Expand Down

0 comments on commit fd9b0ba

Please sign in to comment.