Merge branch 'bboreham-54_reboot'

Closes #54
This commit is contained in:
Matthias Radestock committed 2014-09-24 12:24:31 +01:00
commit ada941cfcb
3 files changed
+25 -7

No files matched your search

+15
View File
@@ -461,6 +461,21 @@ Any running application containers will permanently lose connectivity
with the weave network and have to be restarted in order to
re-connect.
### Reboots
When a host reboots, docker's default behaviour is to restart any
containers that were running. Since weave relies on special network
configuration outside of the containers, the weave network will not
function in this state.
To remedy this, stop and re-launch the weave container, and re-attach
the application containers with `weave attach`.
For a more permanent solution,
[disable Docker's auto-restart feature](https://docs.docker.com/articles/host_integration/)
and create appropriate startup scripts to launch weave and run
application containers from your favourite process manager.
## Installation with Boot2Docker
If you are running Docker inside the Boot2Docker VM, e.g. because you
+1 -1
View File
@@ -3,4 +3,4 @@ MAINTAINER Zettio weave@zett.io
WORKDIR /home/weave
ADD ./weaver /home/weave/
CMD []
ENTRYPOINT ["/home/weave/weaver", "-iface", "ethwe", "-wait"]
ENTRYPOINT ["/home/weave/weaver", "-iface", "ethwe", "-wait", "5"]
+9 -6
View File
@@ -18,17 +18,19 @@ import (
"time"
)
func ensureInterface(ifaceName string, wait bool) (iface *net.Interface, err error) {
func ensureInterface(ifaceName string, wait int) (iface *net.Interface, err error) {
iface, err = findInterface(ifaceName)
if err == nil || !wait {
if err == nil || wait == 0 {
return
}
log.Println("Waiting for interface", ifaceName, "to come up")
for err != nil {
for ; err != nil && wait > 0; wait -= 1 {
time.Sleep(1 * time.Second)
iface, err = findInterface(ifaceName)
}
log.Println("Interface", ifaceName, "is up")
if err == nil {
log.Println("Interface", ifaceName, "is up")
}
return
}
@@ -47,6 +49,7 @@ func main() {
log.SetPrefix(weave.Protocol + " ")
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
log.Println(os.Args)
procs := runtime.NumCPU()
// packet sniffing can block an OS thread, so we need one thread
@@ -60,7 +63,7 @@ func main() {
ifaceName string
routerName string
password string
wait bool
wait int
debug bool
prof string
peers []string
@@ -71,7 +74,7 @@ func main() {
flag.StringVar(&ifaceName, "iface", "", "name of interface to read from")
flag.StringVar(&routerName, "name", "", "name of router (defaults to MAC)")
flag.StringVar(&password, "password", "", "network password")
flag.BoolVar(&wait, "wait", false, "wait for interface to be created and come up")
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up (defaults to 0, i.e. don't wait)")
flag.BoolVar(&debug, "debug", false, "enable debug logging")
flag.StringVar(&prof, "profile", "", "enable profiling and write profiles to given path")
flag.IntVar(&connLimit, "connlimit", 10, "connection limit (defaults to 10, set to 0 for unlimited)")