Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

update the server to include the tap startin #428

Merged
merged 2 commits into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions commands/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/rpc"
"os"
"os/exec"
"runtime"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -38,6 +39,9 @@ func serverFnc(ccmd *cobra.Command, args []string) {

go updateUpdater()

// first up the tap driver (only required on osx)
go startTAP()

// add any registered rpc classes
for _, controller := range registeredRPCs {
rpc.Register(controller)
Expand Down Expand Up @@ -91,3 +95,10 @@ func ClientRun(funcName string, args interface{}, response interface{}) error {

return nil
}

// the tap driver needs to be loaded anytime nanobox is running the vpn (always on osx)
func startTAP() {
if runtime.GOOS == "darwin" {
exec.Command("/sbin/kextload", "/Library/Extensions/tap.kext").Run()
}
}
4 changes: 2 additions & 2 deletions commands/sim/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func startCheck() bool {
provider.Init()
components, _ := app.Components()
for _, component := range components {
info, _ := docker.ContainerInspect(component.ID)
if !info.State.Running {
info, err := docker.ContainerInspect(component.ID)
if err != nil || !info.State.Running {
return false
}
}
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func setupBugsnag() {
event.GroupingHash = fmt.Sprintf("%v", event.Stacktrace)
return nil
})

}

func badTerminal() bool {
Expand Down
1 change: 0 additions & 1 deletion processors/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ func Start() error {
return service.Start("nanobox-server")
}


return util.Retry(fn, 3, time.Second)
}