mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 20:27:01 +08:00
Move certmagic import out of caddy package (#2807)
This commit is contained in:
parent
24b2e02ee5
commit
99914d2204
|
@ -83,6 +83,7 @@ func Run() {
|
||||||
|
|
||||||
caddy.AppName = appName
|
caddy.AppName = appName
|
||||||
caddy.AppVersion = module.Version
|
caddy.AppVersion = module.Version
|
||||||
|
caddy.OnProcessExit = append(caddy.OnProcessExit, certmagic.CleanUpOwnLocks)
|
||||||
certmagic.UserAgent = appName + "/" + cleanModVersion
|
certmagic.UserAgent = appName + "/" + cleanModVersion
|
||||||
|
|
||||||
// Set up process log before anything bad happens
|
// Set up process log before anything bad happens
|
||||||
|
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/caddyserver/caddy/telemetry"
|
"github.com/caddyserver/caddy/telemetry"
|
||||||
"github.com/mholt/certmagic"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TrapSignals create signal handlers for all applicable signals for this
|
// TrapSignals create signal handlers for all applicable signals for this
|
||||||
|
@ -50,7 +49,6 @@ func trapSignalsCrossPlatform() {
|
||||||
for _, f := range OnProcessExit {
|
for _, f := range OnProcessExit {
|
||||||
f() // important cleanup actions only
|
f() // important cleanup actions only
|
||||||
}
|
}
|
||||||
certmagic.CleanUpOwnLocks()
|
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +63,6 @@ func trapSignalsCrossPlatform() {
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
certmagic.CleanUpOwnLocks()
|
|
||||||
os.Exit(executeShutdownCallbacks("SIGINT"))
|
os.Exit(executeShutdownCallbacks("SIGINT"))
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/caddyserver/caddy/telemetry"
|
"github.com/caddyserver/caddy/telemetry"
|
||||||
"github.com/mholt/certmagic"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// trapSignalsPosix captures POSIX-only signals.
|
// trapSignalsPosix captures POSIX-only signals.
|
||||||
|
@ -39,7 +38,6 @@ func trapSignalsPosix() {
|
||||||
for _, f := range OnProcessExit {
|
for _, f := range OnProcessExit {
|
||||||
f() // only perform important cleanup actions
|
f() // only perform important cleanup actions
|
||||||
}
|
}
|
||||||
certmagic.CleanUpOwnLocks()
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
||||||
case syscall.SIGTERM:
|
case syscall.SIGTERM:
|
||||||
|
@ -57,7 +55,6 @@ func trapSignalsPosix() {
|
||||||
telemetry.AppendUnique("sigtrap", "SIGTERM")
|
telemetry.AppendUnique("sigtrap", "SIGTERM")
|
||||||
go telemetry.StopEmitting() // won't finish in time, but that's OK - just don't block
|
go telemetry.StopEmitting() // won't finish in time, but that's OK - just don't block
|
||||||
|
|
||||||
certmagic.CleanUpOwnLocks()
|
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
|
|
||||||
case syscall.SIGUSR1:
|
case syscall.SIGUSR1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user