cmd/tailscaled: move more of the Windows server setup code into tailscaled

Updates #1232
This commit is contained in:
Brad Fitzpatrick
2021-02-05 09:53:54 -08:00
parent 6f7974b7f2
commit a7562be5e1
5 changed files with 127 additions and 9 deletions

View File

@@ -24,7 +24,6 @@ import (
"syscall"
"time"
"github.com/apenwarr/fixconsole"
"tailscale.com/ipn/ipnserver"
"tailscale.com/logpolicy"
"tailscale.com/paths"
@@ -88,11 +87,6 @@ func main() {
flag.StringVar(&args.socketpath, "socket", paths.DefaultTailscaledSocket(), "path of the service unix socket")
flag.BoolVar(&printVersion, "version", false, "print version information and exit")
err := fixconsole.FixConsoleIfNeeded()
if err != nil {
log.Fatalf("fixConsoleOutput: %v", err)
}
if len(os.Args) > 1 && os.Args[1] == "debug" {
if err := debugMode(os.Args[2:]); err != nil {
log.Fatal(err)
@@ -100,6 +94,10 @@ func main() {
return
}
if beWindowsSubprocess() {
return
}
flag.Parse()
if flag.NArg() > 0 {
log.Fatalf("tailscaled does not take non-flag arguments: %q", flag.Args())