Send USR1 on address change
This commit is contained in:
parent
a8944ecb1a
commit
a9b2d89f29
@ -226,6 +226,8 @@ func tryStartShell() error {
|
|||||||
return lastErr
|
return lastErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var add []*service
|
||||||
|
|
||||||
// Supervise continuously restarts the processes specified in commands
|
// Supervise continuously restarts the processes specified in commands
|
||||||
// unless they run DontStartOnBoot.
|
// unless they run DontStartOnBoot.
|
||||||
//
|
//
|
||||||
@ -239,6 +241,9 @@ func Supervise(commands []*exec.Cmd) error {
|
|||||||
services := make([]*service, len(commands))
|
services := make([]*service, len(commands))
|
||||||
for idx, cmd := range commands {
|
for idx, cmd := range commands {
|
||||||
services[idx] = &service{cmd: cmd}
|
services[idx] = &service{cmd: cmd}
|
||||||
|
if cmd.Path == "/user/backupd" {
|
||||||
|
add = append(add, services[idx])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
superviseServices(services)
|
superviseServices(services)
|
||||||
|
|
||||||
@ -269,6 +274,9 @@ func Supervise(commands []*exec.Cmd) error {
|
|||||||
m.Header.Type != syscall.RTM_DELADDR {
|
m.Header.Type != syscall.RTM_DELADDR {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
for _, v := range add {
|
||||||
|
v.Signal(unix.SIGUSR1)
|
||||||
|
}
|
||||||
if err := updateListenerPairs(httpPort, httpsPort, useTLS, tlsConfig); err != nil {
|
if err := updateListenerPairs(httpPort, httpsPort, useTLS, tlsConfig); err != nil {
|
||||||
log.Printf("updating listeners: %v", err)
|
log.Printf("updating listeners: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user