handle ungraceful restarts
This commit is contained in:
@@ -13,6 +13,11 @@ Group=docker
|
|||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
EnvironmentFile=/opt/mistborn/.env
|
EnvironmentFile=/opt/mistborn/.env
|
||||||
|
|
||||||
|
# stop all containers joined to mistborn_default network
|
||||||
|
ExecStartPre=-/usr/bin/bash -c "docker container stop $(docker network inspect mistborn_default | grep Name | tail -n +2 | cut -d':' -f2 | tr -d ',\"') 2>/dev/null"
|
||||||
|
|
||||||
|
# bring down the base service
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml down
|
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml down
|
||||||
|
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml build
|
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml build
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose
|
|||||||
ExecStartPost=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent.sh
|
ExecStartPost=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent.sh
|
||||||
ExecStartPost=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_start.sh
|
ExecStartPost=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_start.sh
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_stop.sh
|
|
||||||
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml down
|
||||||
|
ExecStopPost=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_stop.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=Mistborn-base.service
|
WantedBy=Mistborn-base.service
|
||||||
|
|||||||
Reference in New Issue
Block a user