mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-08 11:58:49 +03:00
Merge pull request #1800 from mholt/exitcodes
Distinguishable exit codes
This commit is contained in:
commit
d3e5f9d456
2 changed files with 3 additions and 3 deletions
|
@ -33,7 +33,7 @@ func trapSignalsCrossPlatform() {
|
||||||
if PidFile != "" {
|
if PidFile != "" {
|
||||||
os.Remove(PidFile)
|
os.Remove(PidFile)
|
||||||
}
|
}
|
||||||
os.Exit(1)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("[INFO] SIGINT: Shutting down")
|
log.Println("[INFO] SIGINT: Shutting down")
|
||||||
|
@ -62,7 +62,7 @@ func executeShutdownCallbacks(signame string) (exitCode int) {
|
||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
log.Printf("[ERROR] %s shutdown: %v", signame, err)
|
log.Printf("[ERROR] %s shutdown: %v", signame, err)
|
||||||
}
|
}
|
||||||
exitCode = 1
|
exitCode = 4
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
|
@ -30,7 +30,7 @@ func trapSignalsPosix() {
|
||||||
err := Stop()
|
err := Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] SIGQUIT stop: %v", err)
|
log.Printf("[ERROR] SIGQUIT stop: %v", err)
|
||||||
exitCode = 1
|
exitCode = 3
|
||||||
}
|
}
|
||||||
if PidFile != "" {
|
if PidFile != "" {
|
||||||
os.Remove(PidFile)
|
os.Remove(PidFile)
|
||||||
|
|
Loading…
Reference in a new issue