diff options
author | Matthew Holt <[email protected]> | 2018-02-13 13:23:09 -0700 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2018-02-13 13:23:09 -0700 |
commit | 08028714b57540a46209b6ab094c0a9cc103830f (patch) | |
tree | 7f4991afb1bbd4afda76521e2060b39d61edcf95 /caddy.go | |
parent | fc2ff9155cc53393ac29885f6de83ed87093b274 (diff) | |
download | caddy-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.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |