Move certmagic import out of caddy package (#2807)

This commit is contained in:
Jonathan Rudenberg 2019-10-14 12:07:36 -04:00 committed by Matt Holt
parent 24b2e02ee5
commit 99914d2204
3 changed files with 1 additions and 6 deletions

View file

@ -83,6 +83,7 @@ func Run() {
caddy.AppName = appName
caddy.AppVersion = module.Version
caddy.OnProcessExit = append(caddy.OnProcessExit, certmagic.CleanUpOwnLocks)
certmagic.UserAgent = appName + "/" + cleanModVersion
// Set up process log before anything bad happens

View file

@ -21,7 +21,6 @@ import (
"sync"
"github.com/caddyserver/caddy/telemetry"
"github.com/mholt/certmagic"
)
// TrapSignals create signal handlers for all applicable signals for this
@ -50,7 +49,6 @@ func trapSignalsCrossPlatform() {
for _, f := range OnProcessExit {
f() // important cleanup actions only
}
certmagic.CleanUpOwnLocks()
os.Exit(2)
}
@ -65,7 +63,6 @@ func trapSignalsCrossPlatform() {
}
go func() {
certmagic.CleanUpOwnLocks()
os.Exit(executeShutdownCallbacks("SIGINT"))
}()
}

View file

@ -23,7 +23,6 @@ import (
"syscall"
"github.com/caddyserver/caddy/telemetry"
"github.com/mholt/certmagic"
)
// trapSignalsPosix captures POSIX-only signals.
@ -39,7 +38,6 @@ func trapSignalsPosix() {
for _, f := range OnProcessExit {
f() // only perform important cleanup actions
}
certmagic.CleanUpOwnLocks()
os.Exit(0)
case syscall.SIGTERM:
@ -57,7 +55,6 @@ func trapSignalsPosix() {
telemetry.AppendUnique("sigtrap", "SIGTERM")
go telemetry.StopEmitting() // won't finish in time, but that's OK - just don't block
certmagic.CleanUpOwnLocks()
os.Exit(exitCode)
case syscall.SIGUSR1: