Commit 69650758 authored by Denis's avatar Denis Committed by Matt Holt

core: instance restart (reload) event (#2178)

parent e54dfa49
...@@ -263,9 +263,10 @@ type EventName string ...@@ -263,9 +263,10 @@ type EventName string
// Define names for the various events // Define names for the various events
const ( const (
StartupEvent EventName = "startup" StartupEvent EventName = "startup"
ShutdownEvent EventName = "shutdown" ShutdownEvent = "shutdown"
CertRenewEvent EventName = "certrenew" CertRenewEvent = "certrenew"
InstanceStartupEvent EventName = "instancestartup" InstanceStartupEvent = "instancestartup"
InstanceRestartEvent = "instancerestart"
) )
// EventHook is a type which holds information about a startup hook plugin. // EventHook is a type which holds information about a startup hook plugin.
......
...@@ -90,6 +90,7 @@ func trapSignalsPosix() { ...@@ -90,6 +90,7 @@ func trapSignalsPosix() {
purgeEventHooks() purgeEventHooks()
// Kick off the restart; our work is done // Kick off the restart; our work is done
EmitEvent(InstanceRestartEvent, nil)
_, err = inst.Restart(caddyfileToUse) _, err = inst.Restart(caddyfileToUse)
if err != nil { if err != nil {
restoreEventHooks(oldEventHooks) restoreEventHooks(oldEventHooks)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment