aboutsummaryrefslogtreecommitdiffhomepage
path: root/sigtrap.go
diff options
context:
space:
mode:
authorToby Allen <[email protected]>2019-07-20 17:48:46 +0100
committerMatt Holt <[email protected]>2019-07-20 10:48:46 -0600
commitd98f2faef960f549c973d747d2e7c484d6e845c7 (patch)
tree142bc82f1797c6024c7b2e0e4b5c31d35c3e2da7 /sigtrap.go
parentb855e661700fa8f9176f29c3c5b1cebd4cc09351 (diff)
downloadcaddy-d98f2faef960f549c973d747d2e7c484d6e845c7.tar.gz
caddy-d98f2faef960f549c973d747d2e7c484d6e845c7.zip
Add /stop endpoint to admin (#2671)
* Add stop command to admin. Exit after stop. * Return error on incorrect http Method and provide better logging. * reuse stopAndCleanup function for all graceful stops
Diffstat (limited to 'sigtrap.go')
-rw-r--r--sigtrap.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/sigtrap.go b/sigtrap.go
index 65f1e964f..8fae706ad 100644
--- a/sigtrap.go
+++ b/sigtrap.go
@@ -18,8 +18,6 @@ import (
"log"
"os"
"os/signal"
-
- "github.com/mholt/certmagic"
)
// TrapSignals create signal/interrupt handlers as best it can for the
@@ -57,16 +55,12 @@ func trapSignalsCrossPlatform() {
func gracefulStop(sigName string) {
exitCode := ExitCodeSuccess
- // first stop all the apps
- err := Stop()
+ err := stopAndCleanup()
if err != nil {
log.Printf("[ERROR] %s stop: %v", sigName, err)
exitCode = ExitCodeFailedQuit
}
- // always, always, always try to clean up locks
- certmagic.CleanUpOwnLocks()
-
log.Printf("[INFO] %s: Shutdown done", sigName)
os.Exit(exitCode)
}