Skip to content

Commit 7b3b309

Browse files
authored
Merge pull request #107 from boinkor-net/better-shutdown
Detach tsnet cancellation from SSH server termination
2 parents 03e82d0 + 50e7e3c commit 7b3b309

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ssh.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ func (s *TailnetSSH) Run(ctx context.Context) error {
8585
return fmt.Errorf("could not setup a tsnet server: %w", err)
8686
}
8787

88-
_, err = srv.Up(ctx)
88+
// Do not shut down the tsnet server as soon as we're meant
89+
// to close client connections; it shuts down after the
90+
// SSH server terminates.
91+
netCtx := context.WithoutCancel(ctx)
92+
_, err = srv.Up(netCtx)
8993
if err != nil {
9094
return fmt.Errorf("could not connect to tailnet: %w", err)
9195
}

0 commit comments

Comments
 (0)