diff --git a/plugins.go b/plugins.go index 5d36f55e2..3d51d1fc1 100644 --- a/plugins.go +++ b/plugins.go @@ -263,9 +263,10 @@ type EventName string // Define names for the various events const ( StartupEvent EventName = "startup" - ShutdownEvent EventName = "shutdown" - CertRenewEvent EventName = "certrenew" - InstanceStartupEvent EventName = "instancestartup" + ShutdownEvent = "shutdown" + CertRenewEvent = "certrenew" + InstanceStartupEvent = "instancestartup" + InstanceRestartEvent = "instancerestart" ) // EventHook is a type which holds information about a startup hook plugin. diff --git a/sigtrap_posix.go b/sigtrap_posix.go index 16c8e8616..9d0bab9cb 100644 --- a/sigtrap_posix.go +++ b/sigtrap_posix.go @@ -90,6 +90,7 @@ func trapSignalsPosix() { purgeEventHooks() // Kick off the restart; our work is done + EmitEvent(InstanceRestartEvent, nil) _, err = inst.Restart(caddyfileToUse) if err != nil { restoreEventHooks(oldEventHooks)