mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Add a timeout on the UNIX admin socket check
This commit is contained in:
		
							parent
							
								
									c940bae9e3
								
							
						
					
					
						commit
						918ce5a3fc
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -403,7 +403,7 @@ func (a *admin) listen() {
 | 
			
		|||
		case "unix":
 | 
			
		||||
			if _, err := os.Stat(a.listenaddr[7:]); err == nil {
 | 
			
		||||
				a.core.log.Debugln("Admin socket", a.listenaddr[7:], "already exists, trying to clean up")
 | 
			
		||||
				if _, err := net.Dial("unix", a.listenaddr[7:]); err == nil {
 | 
			
		||||
				if _, err := net.DialTimeout("unix", a.listenaddr[7:], time.Second*2); err == nil || err.(net.Error).Timeout() {
 | 
			
		||||
					a.core.log.Errorln("Admin socket", a.listenaddr[7:], "already exists and is in use by another process")
 | 
			
		||||
					os.Exit(1)
 | 
			
		||||
				} else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue