From 9fcc15f79b0052b637540d4ca8e526e167202fa8 Mon Sep 17 00:00:00 2001 From: gmega Date: Thu, 19 Jun 2025 20:52:08 -0300 Subject: [PATCH] fix: procmon message for removal from tracking followed by kill --- src/procmon.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/procmon.bash b/src/procmon.bash index 298473f..4a033a6 100644 --- a/src/procmon.bash +++ b/src/procmon.bash @@ -37,9 +37,14 @@ pm_start() { fi exit_code=$(cat "${_pm_output}/${pid}.pid") + # If the cat fails, this means the file was deleted. This will typically + # only happen this way if the process was removed from tracking and then + # killed right after. + # + # shellcheck disable=SC2181 if [ $? -ne 0 ]; then - echoerr "[procmon] ${pid} died with unknown exit code. Aborting." - _pm_halt "halted_no_return" + echoerr "[procmon] ${pid} file vanished (removed from tracking?)" + continue fi if [ -z "$exit_code" ]; then