mirror of https://github.com/samply/bridgehead.git
Got systemctl restart to work locally
There were problems on my Ubuntu VM with the target run level that I was using, so I went for the default. Now, if I restart my VM, the Bridgehead is successfully started automatically. Also added some status-generating commands to the run.sh and stop.sh scripts, so that it looks like they are doing something.
This commit is contained in:
parent
bb81617873
commit
520c560be0
|
@ -5,10 +5,10 @@ Description=Start ECDC Bridgehead
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/srv/docker/bridgehead/restart_service.sh
|
ExecStart=/srv/docker/bridgehead/restart_service.sh
|
||||||
ExecStop=/srv/docker/bridgehead/shutdown_service.sh
|
ExecStop=/srv/docker/bridgehead/shutdown_service.sh
|
||||||
Restart=on-failure
|
Restart=always
|
||||||
RestartSec=36000
|
RestartSec=36000
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi.user.target
|
WantedBy=default.target
|
||||||
|
|
||||||
|
|
15
run.sh
15
run.sh
|
@ -48,12 +48,12 @@ if [ "$UPLOAD" = true ] && [ "$UPLOAD_ALL" = true ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable/stop standard Bridgehead systemctl services, if present
|
# Disable/stop standard Bridgehead systemctl services, if present
|
||||||
sudo systemctl disable bridgehead@bbmri.service
|
sudo systemctl disable bridgehead@bbmri.service >& /dev/null
|
||||||
sudo systemctl disable system-bridgehead.slice
|
sudo systemctl disable system-bridgehead.slice >& /dev/null
|
||||||
sudo systemctl disable bridgehead-update@bbmri.timer
|
sudo systemctl disable bridgehead-update@bbmri.timer >& /dev/null
|
||||||
sudo systemctl stop bridgehead@bbmri.service
|
sudo systemctl stop bridgehead@bbmri.service >& /dev/null
|
||||||
sudo systemctl stop system-bridgehead.slice
|
sudo systemctl stop system-bridgehead.slice >& /dev/null
|
||||||
sudo systemctl stop bridgehead-update@bbmri.timer
|
sudo systemctl stop bridgehead-update@bbmri.timer >& /dev/null
|
||||||
|
|
||||||
# Set up systemctl for EHDS2/ECDC if necessary
|
# Set up systemctl for EHDS2/ECDC if necessary
|
||||||
cp /srv/docker/bridgehead/ecdc.service /etc/systemd/system
|
cp /srv/docker/bridgehead/ecdc.service /etc/systemd/system
|
||||||
|
@ -77,3 +77,6 @@ fi
|
||||||
# Start up the Bridgehead
|
# Start up the Bridgehead
|
||||||
sudo systemctl start ecdc.service
|
sudo systemctl start ecdc.service
|
||||||
|
|
||||||
|
# Show status of Bridgehead service
|
||||||
|
sleep 10
|
||||||
|
systemctl status ecdc.service
|
||||||
|
|
6
stop.sh
6
stop.sh
|
@ -34,6 +34,10 @@ systemctl daemon-reload
|
||||||
systemctl enable ecdc.service
|
systemctl enable ecdc.service
|
||||||
|
|
||||||
# Use systemctl to stop the Bridgehead if it is running
|
# Use systemctl to stop the Bridgehead if it is running
|
||||||
sudo systemctl disable ecdc.service
|
|
||||||
sudo systemctl stop 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