diff --git a/ecdc.service b/ecdc.service index e899ca5..7404737 100644 --- a/ecdc.service +++ b/ecdc.service @@ -5,10 +5,10 @@ Description=Start ECDC Bridgehead Type=simple ExecStart=/srv/docker/bridgehead/restart_service.sh ExecStop=/srv/docker/bridgehead/shutdown_service.sh -Restart=on-failure +Restart=always RestartSec=36000 KillMode=mixed [Install] -WantedBy=multi.user.target +WantedBy=default.target diff --git a/run.sh b/run.sh index 1e6b36c..7a341fc 100644 --- a/run.sh +++ b/run.sh @@ -48,12 +48,12 @@ if [ "$UPLOAD" = true ] && [ "$UPLOAD_ALL" = true ]; then fi # Disable/stop standard Bridgehead systemctl services, if present -sudo systemctl disable bridgehead@bbmri.service -sudo systemctl disable system-bridgehead.slice -sudo systemctl disable bridgehead-update@bbmri.timer -sudo systemctl stop bridgehead@bbmri.service -sudo systemctl stop system-bridgehead.slice -sudo systemctl stop bridgehead-update@bbmri.timer +sudo systemctl disable bridgehead@bbmri.service >& /dev/null +sudo systemctl disable system-bridgehead.slice >& /dev/null +sudo systemctl disable bridgehead-update@bbmri.timer >& /dev/null +sudo systemctl stop bridgehead@bbmri.service >& /dev/null +sudo systemctl stop system-bridgehead.slice >& /dev/null +sudo systemctl stop bridgehead-update@bbmri.timer >& /dev/null # Set up systemctl for EHDS2/ECDC if necessary cp /srv/docker/bridgehead/ecdc.service /etc/systemd/system @@ -77,3 +77,7 @@ fi # Start up the Bridgehead sudo systemctl start ecdc.service +# Show status of Bridgehead service +sleep 10 +systemctl status ecdc.service + diff --git a/stop.sh b/stop.sh index cc71d96..4c6642f 100644 --- a/stop.sh +++ b/stop.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Shut down a running Bridgehead and disable auto restart. +# Shut down a running Bridgehead. # Behind the scenes we use systemctl to do the work. # Function to print usage print_usage() { - echo "Stop the running Bridgehead, disable auto-restart" + echo "Stop the running Bridgehead" echo "Usage: $0 [--help | -h]" echo "Options:" echo " --help, -h Display this help message." @@ -34,6 +34,10 @@ systemctl daemon-reload systemctl enable ecdc.service # Use systemctl to stop the Bridgehead if it is running -sudo systemctl disable ecdc.service sudo systemctl stop ecdc.service +# Show status of Bridgehead service +sleep 20 +systemctl status ecdc.service +docker ps +