Send USR1 on address change

This commit is contained in:
lordwelch 2020-08-22 10:42:13 -07:00
parent a8944ecb1a
commit a9b2d89f29

View File

@ -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)
}