Dynamic python path for systemd exec

This commit is contained in:
nolash 2021-12-04 17:41:38 +01:00
parent a2e96f18b9
commit 52acfda7fc
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,8 @@ PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8
PIP_INDEX_URL=${PIP_INDEX_URL:-"https://pypi.org/simple"}
CIC_SETUP_TRUSTED_FINGERPRINT=${CIC_SETUP_TRUSTED_FINGERPRINT:-0826EDA1702D1E87C6E2875121D2E7BB88C2A746}
CIC_ROOT_URL=${CIC_ROOT_URL:-https://root.grassrootseconomics.net}
default_python_path=$(dirname $(which python))
PYTHON_BIN_PATH=${PYTHON_BIN_PATH:-$default_python_path}
if [ "$UID" -eq 0 ]; then
dbg $dbg_error "This cannot be run as root"

View File

@ -6,7 +6,11 @@ mkdir -vp $HOME/.config/environment.d
_level=2
_debug=1
cp -v systemd/*.service $HOME/.config/systemd/user/
cp -v systemd/cic-cache-server.service $HOME/.config/systemd/user/
cp -v systemd/bloxberg.service $HOME/.config/systemd/user/
dbg $dbg_debug "writing rendered services file $p"
PYTHON_BIN_PATH=$PYTHON_BIN_PATH ./aux/bash-templater/templater.sh systemd/cic-cache-tracker.service > $HOME/.config/systemd/user/cic-cache-tracker.service
for f in systemd/env/*.conf; do
b=`basename $f`
p=$HOME/.config/environment.d/$b

View File

@ -3,7 +3,7 @@ Description=CIC transaction cache syncer
After=network.target
[Service]
ExecStart=%h/.local/bin/cic-cache-trackerd -c %h/.config/cic/cache
ExecStart={{PYTHON_BIN_PATH}}/cic-cache-trackerd -c %h/.config/cic/cache
Restart=always
[Install]