diff --git a/gokrazy.go b/gokrazy.go index 7a69bc4..f161a68 100644 --- a/gokrazy.go +++ b/gokrazy.go @@ -226,6 +226,8 @@ func tryStartShell() error { return lastErr } +var add []*service + // Supervise continuously restarts the processes specified in commands // unless they run DontStartOnBoot. // @@ -239,6 +241,9 @@ func Supervise(commands []*exec.Cmd) error { services := make([]*service, len(commands)) for idx, cmd := range commands { services[idx] = &service{cmd: cmd} + if cmd.Path == "/user/backupd" { + add = append(add, services[idx]) + } } superviseServices(services) @@ -269,6 +274,9 @@ func Supervise(commands []*exec.Cmd) error { m.Header.Type != syscall.RTM_DELADDR { continue } + for _, v := range add { + v.Signal(unix.SIGUSR1) + } if err := updateListenerPairs(httpPort, httpsPort, useTLS, tlsConfig); err != nil { log.Printf("updating listeners: %v", err) }