mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	Distinguishable exit codes
0: normal or expected exit 1: error before server finished starting 2: double SIGINT (force quit) 3: error stopping with SIGQUIT 4: shutdown callback(s) returned error(s)
This commit is contained in:
		
							parent
							
								
									65bc696b0c
								
							
						
					
					
						commit
						cbb85532a8
					
				| @ -33,7 +33,7 @@ func trapSignalsCrossPlatform() { | ||||
| 				if PidFile != "" { | ||||
| 					os.Remove(PidFile) | ||||
| 				} | ||||
| 				os.Exit(1) | ||||
| 				os.Exit(2) | ||||
| 			} | ||||
| 
 | ||||
| 			log.Println("[INFO] SIGINT: Shutting down") | ||||
| @ -62,7 +62,7 @@ func executeShutdownCallbacks(signame string) (exitCode int) { | ||||
| 			for _, err := range errs { | ||||
| 				log.Printf("[ERROR] %s shutdown: %v", signame, err) | ||||
| 			} | ||||
| 			exitCode = 1 | ||||
| 			exitCode = 4 | ||||
| 		} | ||||
| 	}) | ||||
| 	return | ||||
|  | ||||
| @ -30,7 +30,7 @@ func trapSignalsPosix() { | ||||
| 				err := Stop() | ||||
| 				if err != nil { | ||||
| 					log.Printf("[ERROR] SIGQUIT stop: %v", err) | ||||
| 					exitCode = 1 | ||||
| 					exitCode = 3 | ||||
| 				} | ||||
| 				if PidFile != "" { | ||||
| 					os.Remove(PidFile) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user