mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
0a072e93df
commit
48de91a33f
39 changed files with 980 additions and 737 deletions
36
integration-cli/daemon/daemon_unix.go
Normal file
36
integration-cli/daemon/daemon_unix.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// +build !windows
|
||||
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func cleanupExecRoot(c *check.C, execRoot string) {
|
||||
// Cleanup network namespaces in the exec root of this
|
||||
// daemon because this exec root is specific to this
|
||||
// daemon instance and has no chance of getting
|
||||
// cleaned up when a new daemon is instantiated with a
|
||||
// new exec root.
|
||||
netnsPath := filepath.Join(execRoot, "netns")
|
||||
filepath.Walk(netnsPath, func(path string, info os.FileInfo, err error) error {
|
||||
if err := syscall.Unmount(path, syscall.MNT_FORCE); err != nil {
|
||||
c.Logf("unmount of %s failed: %v", path, err)
|
||||
}
|
||||
os.Remove(path)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// SignalDaemonDump sends a signal to the daemon to write a dump file
|
||||
func SignalDaemonDump(pid int) {
|
||||
syscall.Kill(pid, syscall.SIGQUIT)
|
||||
}
|
||||
|
||||
func signalDaemonReload(pid int) error {
|
||||
return syscall.Kill(pid, syscall.SIGHUP)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue