feat(gateway): Prüfskript für Python-Interpreter im MC2-Virtualenv
- check_venv.sh prüft Existenz + Ausführbarkeit des Interpreters - Gibt bei Erfolg 0 zurück, sonst 1 mit klarer Fehlermeldung - Wird als ExecStartPre= in der systemd-Unit eingebunden Hinweis für Commander: Die systemd-Unit deploy/mc2-gateway.service muss nach Annahme manuell um ExecStartPre=... erweitert werden.
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Prüft, ob der Python-Interpreter im MC2-Virtualenv existiert und ausfuehrbar ist.
|
||||
# Gibt bei Erfolg 0 zurueck, sonst 1 mit klarer Fehlermeldung.
|
||||
#
|
||||
# Aufruf: ./check_venv.sh
|
||||
# Ziel-Pfad: /home/hitonabi/mission-control-v2/backend/.venv/bin/python
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
VENV_PYTHON="/home/hitonabi/mission-control-v2/backend/.venv/bin/python"
|
||||
|
||||
if [[ ! -f "$VENV_PYTHON" ]]; then
|
||||
echo "FEHLER: Python-Interpreter nicht gefunden: $VENV_PYTHON" >&2
|
||||
echo "Hinweis: Virtualenv fuer MC2-Gateway wurde nicht erstellt oder ist beschädigt." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x "$VENV_PYTHON" ]]; then
|
||||
echo "FEHLER: Python-Interpreter nicht ausfuehrbar: $VENV_PYTHON" >&2
|
||||
echo "Hinweis: Dateiberechtigungen pruefen." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Optional: Kurze Funktionspruefung (Version ausgeben, ohne Side Effects)
|
||||
if ! "$VENV_PYTHON" --version >/dev/null 2>&1; then
|
||||
echo "FEHLER: Python-Interpreter ist defekt oder fehlt essentielle Pakete." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "OK: Python-Interpreter ist verfuegbar: $VENV_PYTHON ($("$VENV_PYTHON" --version 2>&1 | head -n1))"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user