mirror of
https://github.com/samply/bridgehead.git
synced 2026-10-12 22:56:41 +02:00
Guard against conflicts in Systemd's shutdown orchestration
This commit is contained in:
@@ -127,6 +127,11 @@ case "$ACTION" in
|
||||
exec $COMPOSE -p $PROJECT -f ./minimal/docker-compose.yml -f ./$PROJECT/docker-compose.yml $OVERRIDE up --abort-on-container-exit
|
||||
;;
|
||||
stop)
|
||||
# INVOCATION_ID is set by Systemd, so manual commands and Systemd's orchestration does not interfer
|
||||
if [ -z "${INVOCATION_ID:-}" ] && systemctl is-active --quiet "bridgehead@$PROJECT"; then
|
||||
log ERROR "bridgehead@$PROJECT is managed by systemd. Stop it with: sudo systemctl stop bridgehead@$PROJECT"
|
||||
exit 1
|
||||
fi
|
||||
loadVars
|
||||
# Kill stale secret-sync instances if present
|
||||
docker kill $(docker ps -q --filter ancestor=docker.verbis.dkfz.de/cache/samply/secret-sync-local) 2>/dev/null || true
|
||||
|
||||
@@ -8,7 +8,10 @@ Restart=always
|
||||
RestartSec=30
|
||||
ExecStartPre=-/srv/docker/bridgehead/bridgehead preRun %i
|
||||
ExecStart=/srv/docker/bridgehead/bridgehead start %i
|
||||
ExecStop=/srv/docker/bridgehead/bridgehead stop %i
|
||||
SuccessExitStatus=130
|
||||
TimeoutStopSec=120
|
||||
# Clean up containers after stop
|
||||
ExecStopPost=-/srv/docker/bridgehead/bridgehead stop %i
|
||||
ExecStopPost=-/srv/docker/bridgehead/bridgehead postRun %i
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user