aboutsummaryrefslogtreecommitdiff
path: root/core/restart.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/restart.go')
-rw-r--r--core/restart.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/restart.go b/core/restart.go
index 1c053c13c..aa77e152d 100644
--- a/core/restart.go
+++ b/core/restart.go
@@ -117,6 +117,9 @@ func Restart(newCorefile Input) error {
}
wpipe.Close()
+ // Run all shutdown functions for the middleware, if child start fails, restart them all...
+ executeShutdownCallbacks("SIGUSR1")
+
// Determine whether child startup succeeded
answer, readErr := ioutil.ReadAll(sigrpipe)
if answer == nil || len(answer) == 0 {
@@ -125,6 +128,9 @@ func Restart(newCorefile Input) error {
if readErr != nil {
log.Printf("[ERROR] Restart: additionally, error communicating with child process: %v", readErr)
}
+ // re-call all startup functions.
+ // TODO(miek): this needs to be tested, somehow.
+ executeStartupCallbacks("SIGUSR1")
return errIncompleteRestart
}