for now always restart docker daemon, not send HUP as most changes require it

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-01-26 11:49:04 +00:00
parent 8b86109756
commit c540664234

View File

@ -5,6 +5,7 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"os/exec"
"strconv" "strconv"
"syscall" "syscall"
) )
@ -43,15 +44,24 @@ func main() {
if n == 0 { if n == 0 {
continue continue
} }
bytes, err := ioutil.ReadFile(huppidfile) // a few changes eg debug do not require a daemon restart
if err != nil { // however at present we cannot check changes, and most do
continue restart := true
if restart {
cmd := exec.Command("service", "docker", "restart")
// not much we can do if it does not restart
_ = cmd.Run()
} else {
bytes, err := ioutil.ReadFile(huppidfile)
if err != nil {
continue
}
pidstring := string(bytes[:])
pid, err := strconv.Atoi(pidstring)
if err != nil {
continue
}
syscall.Kill(pid, syscall.SIGHUP)
} }
pidstring := string(bytes[:])
pid, err := strconv.Atoi(pidstring)
if err != nil {
continue
}
syscall.Kill(pid, syscall.SIGHUP)
} }
} }