From 4c76609576afa5d3c313dfd2c45c9f5640d0c6d1 Mon Sep 17 00:00:00 2001 From: Brian Joerger Date: Wed, 16 Oct 2024 13:02:56 -0700 Subject: [PATCH] Ignore SIGQUIT in the networking process, let it gracefully close when the parent closes. (#47515) --- lib/srv/reexec.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/srv/reexec.go b/lib/srv/reexec.go index 9984962ed74b..2812ee8649ba 100644 --- a/lib/srv/reexec.go +++ b/lib/srv/reexec.go @@ -535,6 +535,12 @@ func (o *osWrapper) startNewParker(ctx context.Context, credential *syscall.Cred } func RunNetworking() (errw io.Writer, code int, err error) { + // SIGQUIT is used by teleport to initiate graceful shutdown, waiting for + // existing exec sessions to close before ending the process. For this to + // work when closing the entire teleport process group, exec sessions must + // ignore SIGQUIT signals. + signal.Ignore(syscall.SIGQUIT) + // errorWriter is used to return any error message back to the client. // Use stderr so that it's not forwarded to the remote client. errorWriter := os.Stderr