mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-06-26 04:51:34 +02:00
Fix WorkingDirectory in service files to prevent shadowing of pip-installed package
This commit is contained in:
@@ -372,6 +372,13 @@ if grep -q 'PYTHONPATH' "$SVC_UNIT" 2>/dev/null; then
|
||||
sed -i '/^Environment=.*PYTHONPATH/d' "$SVC_UNIT"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
# Migration: fix WorkingDirectory if it still points at the old source checkout.
|
||||
# /opt/pymc_repeater contains a repeater/ subdirectory which shadows the
|
||||
# pip-installed package, causing updates to have no effect on the running process.
|
||||
if grep -q 'WorkingDirectory=/opt/pymc_repeater' "$SVC_UNIT" 2>/dev/null; then
|
||||
sed -i 's|WorkingDirectory=/opt/pymc_repeater|WorkingDirectory=/var/lib/pymc_repeater|' "$SVC_UNIT"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
exec python3 -m pip install \
|
||||
--break-system-packages \
|
||||
--no-cache-dir \
|
||||
@@ -691,6 +698,13 @@ if grep -q 'PYTHONPATH' "$SVC_UNIT" 2>/dev/null; then
|
||||
sed -i '/^Environment=.*PYTHONPATH/d' "$SVC_UNIT"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
# Migration: fix WorkingDirectory if it still points at the old source checkout.
|
||||
# /opt/pymc_repeater contains a repeater/ subdirectory which shadows the
|
||||
# pip-installed package, causing updates to have no effect on the running process.
|
||||
if grep -q 'WorkingDirectory=/opt/pymc_repeater' "$SVC_UNIT" 2>/dev/null; then
|
||||
sed -i 's|WorkingDirectory=/opt/pymc_repeater|WorkingDirectory=/var/lib/pymc_repeater|' "$SVC_UNIT"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
exec python3 -m pip install \
|
||||
--break-system-packages \
|
||||
--no-cache-dir \
|
||||
|
||||
@@ -10,7 +10,7 @@ Wants=network-online.target
|
||||
Type=simple
|
||||
User=repeater
|
||||
Group=repeater
|
||||
WorkingDirectory=/opt/pymc_repeater
|
||||
WorkingDirectory=/var/lib/pymc_repeater
|
||||
|
||||
# Start command - use python module directly with proper path
|
||||
ExecStart=/usr/bin/python3 -m repeater.main --config /etc/pymc_repeater/config.yaml
|
||||
|
||||
Reference in New Issue
Block a user