contrib/systemd: Adjusted service file and script for python venv

This commit is contained in:
Athanasius 2021-06-14 15:52:39 +01:00
parent 415f5bb17d
commit 4c2f379480
2 changed files with 6 additions and 6 deletions

View File

@ -1,3 +1,3 @@
CONFIG_OVERRIDE="${HOME}/.local/share/eddn/config.json"
LOG_DIR="${HOME}/.var/log/eddn"
PYTHON_VENV_ACTIVATE="${HOME}/eddn/python2.7-venv/bin/activate"
PYTHON_VENV="${HOME}/eddn/python-venv"

View File

@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/sh
# vim: tabstop=2 shiftwidth=2 textwidth=0 wrapmargin=0 expandtab
#
# Start an EDDN Service, including redirecting output to a log file.
@ -26,12 +26,12 @@ fi
. ./eddn_config
# Use the python venv
. "${PYTHON_VENV_ACTIVATE}"
. "${PYTHON_VENV}/bin/activate"
if [ ! -f eddn-${SERVICE} ];
if [ ! -f "${PYTHON_VENV}/bin/${SERVICE}" ];
then
echo "eddn-${SERVICE} is missing from $(pwd)"
echo "${SERVICE} is missing from ${PYTHON_VENV}/bin"
exit 2
fi
./eddn-${SERVICE} --config "${CONFIG_OVERRIDE}" >> "${LOG_DIR}/eddn-${SERVICE}.log" 2>&1
${PYTHON_VENV}/bin/${SERVICE} --config "${CONFIG_OVERRIDE}" >> "${LOG_DIR}/${SERVICE}.log" 2>&1