mirror of
				https://github.com/samply/bridgehead.git
				synced 2025-11-04 04:50:17 +01:00 
			
		
		
		
	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:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								run.sh
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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,6 @@ fi
 | 
			
		||||
# Start up the Bridgehead
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user