From 91997c9abcd4d16c104b771a39f42bb3bbdc609d Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Tue, 20 Feb 2024 10:42:13 -0600 Subject: [PATCH] runners: try not to eat up the stack --- internal/olsrd/run.go | 6 +++++- internal/vtun/run.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/olsrd/run.go b/internal/olsrd/run.go index aad476a9..530d35a8 100644 --- a/internal/olsrd/run.go +++ b/internal/olsrd/run.go @@ -40,7 +40,11 @@ func run(ctx context.Context, stopChan chan struct{}) { } else { fmt.Println("OLSR process exited, restarting it") } - run(ctx, stopChan) + err = olsrCmd.Process.Signal(os.Signal(syscall.SIGKILL)) + if err != nil { + log.Printf("failed to kill process: %v\n", err) + } + go run(ctx, stopChan) case <-ctx.Done(): err = <-processResults if err != nil { diff --git a/internal/vtun/run.go b/internal/vtun/run.go index 0ba7ded5..b03ba460 100644 --- a/internal/vtun/run.go +++ b/internal/vtun/run.go @@ -40,7 +40,11 @@ func run(ctx context.Context, stopChan chan struct{}) { } else { fmt.Println("VTun process exited, restarting it") } - run(ctx, stopChan) + err = vtunCmd.Process.Signal(os.Signal(syscall.SIGKILL)) + if err != nil { + log.Printf("failed to kill process: %v\n", err) + } + go run(ctx, stopChan) case <-ctx.Done(): err = <-processResults if err != nil {