Skip to content

Commit 6300aca

Browse files
committed
fix: allow daemons on Windows
Windows won't allow the forked command to start while stdin is being held open. This means that daemons won't work on Windows. This fix bypasses this by not providing os.Stdin to the forked command. Signed-off-by: Donnie Adams <[email protected]>
1 parent abd8517 commit 6300aca

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pkg/daemon/daemon.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ func SysDaemon() error {
1717
}()
1818

1919
cmd := exec.CommandContext(ctx, os.Args[2], os.Args[3:]...)
20-
cmd.Stdin = os.Stdin
2120
cmd.Stderr = os.Stderr
2221
cmd.Stdout = os.Stdout
2322
return cmd.Run()

pkg/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func complete(opts *Options) (result *Options) {
4343

4444
result.ListenAddress = types.FirstSet(result.ListenAddress, result.ListenAddress)
4545
if result.ListenAddress == "" {
46-
result.ListenAddress = "127.0.0.1:9090"
46+
result.ListenAddress = "127.0.0.1:0"
4747
}
4848

4949
return

0 commit comments

Comments
 (0)