Send USR1 on address change
This commit is contained in:
parent
a8944ecb1a
commit
a9b2d89f29
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user