mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 18:41:37 +00:00
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:
parent
8b86109756
commit
c540664234
@ -5,6 +5,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
@ -43,6 +44,14 @@ func main() {
|
|||||||
if n == 0 {
|
if n == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// a few changes eg debug do not require a daemon restart
|
||||||
|
// however at present we cannot check changes, and most do
|
||||||
|
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)
|
bytes, err := ioutil.ReadFile(huppidfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
@ -54,4 +63,5 @@ func main() {
|
|||||||
}
|
}
|
||||||
syscall.Kill(pid, syscall.SIGHUP)
|
syscall.Kill(pid, syscall.SIGHUP)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user