]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/rv: Stop gracefully also on SIGTERM
authorGabriele Monaco <gmonaco@redhat.com>
Wed, 23 Jul 2025 16:12:37 +0000 (18:12 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 24 Jul 2025 14:43:46 +0000 (10:43 -0400)
Currently the userspace RV tool starts a monitor and waits for the user
to press Ctrl-C (SIGINT) to terminate and stop the monitor.
This doesn't account for a scenario where a user starts RV in background
and simply kills it (SIGTERM unless the user specifies differently).
E.g.:
 # rv mon wip &
 # kill %

Would terminate RV without stopping the monitor and next RV executions
won't start correctly.

Register the signal handler used for SIGINT also to SIGTERM.

Cc: Nam Cao <namcao@linutronix.de>
Cc: Tomas Glozar <tglozar@redhat.com>
Cc: Juri Lelli <jlelli@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Link: https://lore.kernel.org/20250723161240.194860-3-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
tools/verification/rv/src/rv.c

index 239de054d1e069312bf00b5c4fcf7d0a015c9c05..b8fe24a87d97c6e7f9860c42de02ef2fd57eab35 100644 (file)
@@ -191,6 +191,7 @@ int main(int argc, char **argv)
                 * and exit.
                 */
                signal(SIGINT, stop_rv);
+               signal(SIGTERM, stop_rv);
 
                rv_mon(argc - 1, &argv[1]);
        }