From 71219d5051156b3a6bf634f37a424f1779f4293d Mon Sep 17 00:00:00 2001 From: AbrJA Date: Wed, 13 Mar 2024 17:29:39 -0600 Subject: [PATCH 1/2] Bug fix: Killing background processes --- R/BackendRserve.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/BackendRserve.R b/R/BackendRserve.R index c736ba7..a76271e 100644 --- a/R/BackendRserve.R +++ b/R/BackendRserve.R @@ -347,10 +347,10 @@ ApplicationProcess = R6::R6Class( #' Send signal to process. #' @param signal Singal code. kill = function(signal = 15L) { - # kill service - tools::pskill(self$pid, signal) - # kill childs - system(sprintf("pkill -%s -P %s", signal, self$pid), wait = FALSE) + # get childs + child_pids <- suppressWarnings(system(sprintf("pgrep -P %s", self$pid), intern = TRUE)) + # kill all + tools::pskill(c(self$pid, child_pids), signal) } ) ) From a8bf1ef9342e008745894a718ca716d0514e62ee Mon Sep 17 00:00:00 2001 From: AbrJA Date: Wed, 13 Mar 2024 17:32:04 -0600 Subject: [PATCH 2/2] Typos correction --- R/BackendRserve.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/BackendRserve.R b/R/BackendRserve.R index a76271e..3139069 100644 --- a/R/BackendRserve.R +++ b/R/BackendRserve.R @@ -330,7 +330,7 @@ BackendRserve = R6::R6Class( #' @title Creates ApplicationProcess object #' #' @description -#' Creates ApplicationProcess to hold PID of the runnung applicaiton. +#' Creates ApplicationProcess to hold PID of the running application. #' ApplicationProcess = R6::R6Class( classname = "ApplicationProcess", @@ -345,7 +345,7 @@ ApplicationProcess = R6::R6Class( }, #' @description #' Send signal to process. - #' @param signal Singal code. + #' @param signal Signal code. kill = function(signal = 15L) { # get childs child_pids <- suppressWarnings(system(sprintf("pgrep -P %s", self$pid), intern = TRUE))