Restart libvirtd after firewalld.service restart
Starting libvirtd.service provides iptable rules for NATed network virbr0. When starting firewalld.service after libvirtd, these rules will be overwritten. So NAT will no longer work. Restart of libvirtd fixes the rules again.
This commit is contained in:
		
							parent
							
								
									4b982205ba
								
							
						
					
					
						commit
						43157dd810
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,12 @@
 | 
			
		|||
 | 
			
		||||
if [[ "${PAM_USER}" =~ -exam$ ]]; then
 | 
			
		||||
  systemctl start firewalld.service
 | 
			
		||||
  if systemctl is-enabled --quiet libvirtd.service; then
 | 
			
		||||
    systemctl restart libvirtd.service
 | 
			
		||||
  fi
 | 
			
		||||
elif ! (users | grep -q -- "-exam"); then
 | 
			
		||||
   systemctl stop firewalld.service
 | 
			
		||||
  systemctl stop firewalld.service
 | 
			
		||||
  if systemctl is-enabled --quiet libvirtd.service; then
 | 
			
		||||
    systemctl restart libvirtd.service
 | 
			
		||||
  fi
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue