fix(agent): Allow signal propagation when running as PID 1 (#6141)

This commit is contained in:
Mathias Fredriksson
2023-02-09 23:07:21 +02:00
committed by GitHub
parent af59e2bcfa
commit 6f3f7f2937
4 changed files with 89 additions and 11 deletions

View File

@ -68,7 +68,10 @@ func workspaceAgent() *cobra.Command {
// Do not start a reaper on the child process. It's important
// to do this else we fork bomb ourselves.
args := append(os.Args, "--no-reap")
err := reaper.ForkReap(reaper.WithExecArgs(args...))
err := reaper.ForkReap(
reaper.WithExecArgs(args...),
reaper.WithCatchSignals(InterruptSignals...),
)
if err != nil {
logger.Error(ctx, "failed to reap", slog.Error(err))
return xerrors.Errorf("fork reap: %w", err)