summaryrefslogtreecommitdiffhomepage
path: root/caddy.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2018-02-13 13:23:09 -0700
committerMatthew Holt <[email protected]>2018-02-13 13:23:09 -0700
commit08028714b57540a46209b6ab094c0a9cc103830f (patch)
tree7f4991afb1bbd4afda76521e2060b39d61edcf95 /caddy.go
parentfc2ff9155cc53393ac29885f6de83ed87093b274 (diff)
downloadcaddy-08028714b57540a46209b6ab094c0a9cc103830f.tar.gz
caddy-08028714b57540a46209b6ab094c0a9cc103830f.zip
tls: Synchronize renewals between Caddy instances sharing file storage
Also introduce caddy.OnProcessExit which is a list of functions that run before exiting the process cleanly; these do not count as shutdown callbacks, so they do not return errors and must execute quickly.
Diffstat (limited to 'caddy.go')
-rw-r--r--caddy.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/caddy.go b/caddy.go
index dd2d473a9..628673a73 100644
--- a/caddy.go
+++ b/caddy.go
@@ -77,6 +77,14 @@ var (
mu sync.Mutex
)
+func init() {
+ OnProcessExit = append(OnProcessExit, func() {
+ if PidFile != "" {
+ os.Remove(PidFile)
+ }
+ })
+}
+
// Instance contains the state of servers created as a result of
// calling Start and can be used to access or control those servers.
// It is literally an instance of a server type. Instance values