diff --git a/script/systemd/install_daemon.py b/script/systemd/install_daemon.py index 9f0ef6a..0369940 100755 --- a/script/systemd/install_daemon.py +++ b/script/systemd/install_daemon.py @@ -9,6 +9,20 @@ import subprocess import sys from pathlib import Path +# « ExecStart=/bin/bash …/run.sh » et non le script seul. +# +# Lancé seul, systemd doit EXÉCUTER le fichier, et l'échoue en « 203/EXEC » +# dans quatre cas au moins : bit x absent, shebang qui ne résout pas, /home +# monté noexec, SELinux refusant l'execve. Vécu sur openSUSE s390x — le +# processus mourait en 3 ms, sans jamais entrer dans le script, ce qui rend le +# diagnostic très pénible : aucune sortie, et un code qui ressemble à une +# erreur d'application. +# +# Passé à bash, run.sh n'est plus qu'une DONNÉE lue : les quatre causes +# disparaissent ensemble, y compris noexec et SELinux, qui ne portent que sur +# l'execve. Rien n'est perdu au passage — le shebang du script désigne déjà +# bash. C'est aussi ce que font install_daemon.sh et le générateur de todo.py, +# les trois écrivant la même unité. UNIT_TEMPLATE = """[Unit] Description=ERPLibre for {user} Requires=postgresql.service @@ -23,7 +37,8 @@ Group={user} Restart=always RestartSec=5 PIDFile={home_erplibre}/.venv.erplibre/service.pid -ExecStart={home_erplibre}/run.sh{EXEC_PARAM} +# bash explicite : voir install_daemon.py (evite 203/EXEC). +ExecStart=/bin/bash {home_erplibre}/run.sh{EXEC_PARAM} WorkingDirectory={home_erplibre} StandardOutput=journal+console diff --git a/script/systemd/install_daemon.sh b/script/systemd/install_daemon.sh index cfc2bd2..922872e 100755 --- a/script/systemd/install_daemon.sh +++ b/script/systemd/install_daemon.sh @@ -31,7 +31,7 @@ Group=${EL_USER} Restart=always RestartSec=5 PIDFile=${EL_HOME_ERPLIBRE}/.venv.erplibre/service.pid -ExecStart=${EL_HOME_ERPLIBRE}/run.sh +ExecStart=/bin/bash ${EL_HOME_ERPLIBRE}/run.sh WorkingDirectory=${EL_HOME_ERPLIBRE} StandardOutput=journal+console diff --git a/script/todo/todo.py b/script/todo/todo.py index d8ea5c6..641dd66 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -5421,7 +5421,7 @@ class TODO: "Group=$SVC_GROUP\n" "Restart=always\n" "RestartSec=5\n" - "ExecStart=$SVC_DIR/run.sh\n" + "ExecStart=/bin/bash $SVC_DIR/run.sh\n" "WorkingDirectory=$SVC_DIR\n" "StandardOutput=journal+console\n" "$SELINUX_LINE\n"