mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
commit
c6f278fc3f
5 changed files with 53 additions and 16 deletions
|
@ -5,8 +5,8 @@ dockerargs = --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -
|
||||||
container_env = -e "INSIDECONTAINER=-incontainer=true"
|
container_env = -e "INSIDECONTAINER=-incontainer=true"
|
||||||
docker = docker run --rm -it ${dockerargs} $$EXTRA_ARGS ${container_env} ${build_image}
|
docker = docker run --rm -it ${dockerargs} $$EXTRA_ARGS ${container_env} ${build_image}
|
||||||
ciargs = -e CIRCLECI -e "COVERALLS_TOKEN=$$COVERALLS_TOKEN" -e "INSIDECONTAINER=-incontainer=true"
|
ciargs = -e CIRCLECI -e "COVERALLS_TOKEN=$$COVERALLS_TOKEN" -e "INSIDECONTAINER=-incontainer=true"
|
||||||
cidocker = docker run ${dockerargs} ${ciargs} ${container_env} ${build_image}
|
cidocker = docker run ${dockerargs} ${ciargs} $$EXTRA_ARGS ${container_env} ${build_image}
|
||||||
CROSS_PLATFORMS = linux/amd64 linux/386 linux/arm windows/amd64 windows/386 solaris/amd64 solaris/386
|
CROSS_PLATFORMS = linux/amd64 linux/386 linux/arm windows/amd64
|
||||||
|
|
||||||
all: ${build_image}.created build check integration-tests clean
|
all: ${build_image}.created build check integration-tests clean
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"github.com/docker/docker/pkg/reexec"
|
"github.com/docker/docker/pkg/reexec"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
psignal "github.com/docker/docker/pkg/signal"
|
|
||||||
"github.com/docker/docker/pkg/term"
|
"github.com/docker/docker/pkg/term"
|
||||||
"github.com/docker/libnetwork"
|
"github.com/docker/libnetwork"
|
||||||
"github.com/docker/libnetwork/api"
|
"github.com/docker/libnetwork/api"
|
||||||
|
@ -263,16 +262,6 @@ func (d *dnetConnection) dnetDaemon(cfgFile string) error {
|
||||||
return http.ListenAndServe(d.addr, r)
|
return http.ListenAndServe(d.addr, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupDumpStackTrap() {
|
|
||||||
c := make(chan os.Signal, 1)
|
|
||||||
signal.Notify(c, syscall.SIGUSR1)
|
|
||||||
go func() {
|
|
||||||
for range c {
|
|
||||||
psignal.DumpStacks()
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
func handleSignals(controller libnetwork.NetworkController) {
|
func handleSignals(controller libnetwork.NetworkController) {
|
||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT}
|
signals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT}
|
||||||
|
|
19
libnetwork/cmd/dnet/dnet_linux.go
Normal file
19
libnetwork/cmd/dnet/dnet_linux.go
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
psignal "github.com/docker/docker/pkg/signal"
|
||||||
|
)
|
||||||
|
|
||||||
|
func setupDumpStackTrap() {
|
||||||
|
c := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(c, syscall.SIGUSR1)
|
||||||
|
go func() {
|
||||||
|
for range c {
|
||||||
|
psignal.DumpStacks()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
28
libnetwork/cmd/dnet/dnet_windows.go
Normal file
28
libnetwork/cmd/dnet/dnet_windows.go
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/Sirupsen/logrus"
|
||||||
|
"github.com/docker/docker/pkg/signal"
|
||||||
|
"github.com/docker/docker/pkg/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Copied over from docker/daemon/debugtrap_windows.go
|
||||||
|
func setupDumpStackTrap() {
|
||||||
|
go func() {
|
||||||
|
sa := syscall.SecurityAttributes{
|
||||||
|
Length: 0,
|
||||||
|
}
|
||||||
|
ev := "Global\\docker-daemon-" + fmt.Sprint(os.Getpid())
|
||||||
|
if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 {
|
||||||
|
logrus.Debugf("Stackdump - waiting signal at %s", ev)
|
||||||
|
for {
|
||||||
|
syscall.WaitForSingleObject(h, syscall.INFINITE)
|
||||||
|
signal.DumpStacks()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
// Package ipamutils provides utililty functions for ipam management
|
package netutils
|
||||||
package ipamutils
|
|
||||||
|
|
||||||
// Solaris: TODO
|
// Solaris: TODO
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
|
"github.com/docker/libnetwork/ipamutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ElectInterfaceAddresses looks for an interface on the OS with the specified name
|
// ElectInterfaceAddresses looks for an interface on the OS with the specified name
|
||||||
|
@ -17,7 +18,7 @@ func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error) {
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
v4Net, err = FindAvailableNetwork(PredefinedBroadNetworks)
|
v4Net, err = FindAvailableNetwork(ipamutils.PredefinedBroadNetworks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue