mirror of https://github.com/samply/bridgehead.git
Got automatic Bridgehead restart to work
Cherry picked from ehds2_develop branch
This commit is contained in:
parent
1b9af45991
commit
56cdd0dcc4
|
@ -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
|
||||
|
||||
|
|
16
run.sh
16
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
|
||||
|
||||
|
|
10
stop.sh
10
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue