ipn/ipnlocal: fix 'tailscale up' on Windows without GUI

With this, I can now:

* install Tailscale
* stop the GUI
* net stop Tailscale
* net start Tailscale
* tailscale up --unattended

(where the middle three steps simulate what would happen on a Windows
Server Core machine without a GUI)

Fixes #2137

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-07-19 11:07:42 -07:00
committed by Brad Fitzpatrick
parent 7f7a81e5ae
commit b6d70203d3
2 changed files with 58 additions and 10 deletions

View File

@@ -179,6 +179,7 @@ func NewLocalBackend(logf logger.Logf, logid string, store ipn.StateStore, e wge
gotPortPollRes: make(chan struct{}),
}
b.statusChanged = sync.NewCond(&b.statusLock)
b.e.SetStatusCallback(b.setWgengineStatus)
linkMon := e.GetLinkMonitor()
b.prevIfState = linkMon.InterfaceState()
@@ -610,8 +611,8 @@ func (b *LocalBackend) setWgengineStatus(s *wgengine.Status, err error) {
if cc != nil {
cc.UpdateEndpoints(0, s.LocalAddrs)
b.stateMachine()
}
b.stateMachine()
b.statusLock.Lock()
b.statusChanged.Broadcast()
@@ -868,7 +869,6 @@ func (b *LocalBackend) Start(opts ipn.Options) error {
}
cc.SetStatusFunc(b.setClientStatus)
b.e.SetStatusCallback(b.setWgengineStatus)
b.e.SetNetInfoCallback(b.setNetInfo)
b.mu.Lock()