From 5ece9dc514b1fbba21e36a34f7fae42812e1d33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Sun, 16 Feb 2020 18:07:36 +0000 Subject: server kills subprocesses correctly on cancel --- internal/server/handlers/runcommand.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/server/handlers/runcommand.go') diff --git a/internal/server/handlers/runcommand.go b/internal/server/handlers/runcommand.go index 120c402..95db52f 100644 --- a/internal/server/handlers/runcommand.go +++ b/internal/server/handlers/runcommand.go @@ -92,4 +92,8 @@ func (r runCommand) start(ctx context.Context, command string) { r.server.sendServerMessage(fmt.Sprintf(".run exitstatus %d", ec)) r.server.sendServerMessage(logger.Info(fmt.Sprintf("Process %d exited with status %d", pid, ec))) + + logger.Debug(r.server.user, "Waiting for Pgroup to be killed") + <-r.run.PgroupKilled() + logger.Debug(r.server.user, "Pgroup killed") } -- cgit v1.2.3