fix(sync): export SYNC_BASE_PATH so the Python child inherits it

The shell fallback was assigned locally but never exported, so
sync_watcher.py and the Python config layer never saw the resolved
value. They happened to land on the same /var/lib/romm/sync default by
coincidence; export it so the shell and Python defaults stay linked
through a single source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-05-17 17:22:54 -04:00
parent e5c9d0faf7
commit ea22b06502
2 changed files with 5 additions and 5 deletions

View File

@@ -248,18 +248,18 @@ start_bin_watcher() {
start_bin_sync_watcher() {
info_log "Starting sync folder watcher"
local sync_base_path="${SYNC_BASE_PATH:-/var/lib/romm/sync}"
mkdir -p "${sync_base_path}"
export SYNC_BASE_PATH="${SYNC_BASE_PATH:-/var/lib/romm/sync}"
mkdir -p "${SYNC_BASE_PATH}"
if [[ ${OTEL_SDK_DISABLED:-false} == "true" ]]; then
watchfiles \
--target-type command \
"python3 sync_watcher.py" \
"${sync_base_path}" &
"${SYNC_BASE_PATH}" &
else
watchfiles \
--target-type command \
"opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}sync_watcher' python3 sync_watcher.py" \
"${sync_base_path}" &
"${SYNC_BASE_PATH}" &
fi
SYNC_WATCHER_PID=$!
echo "${SYNC_WATCHER_PID}" >/tmp/sync_watcher.pid

View File

@@ -80,7 +80,7 @@ watchfiles \
if [[ ${ENABLE_SYNC_FOLDER_WATCHER:-false} == "true" ]]; then
echo "Starting sync folder watcher..."
SYNC_BASE_PATH="${SYNC_BASE_PATH:-/var/lib/romm/sync}"
export SYNC_BASE_PATH="${SYNC_BASE_PATH:-/var/lib/romm/sync}"
mkdir -p "${SYNC_BASE_PATH}"
watchfiles \
--target-type command \