From 4cc40e829870dd6a1d9714706d38f5fd4b2ec982 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 1 Apr 2009 14:49:12 -0700 Subject: PR10016: Purge stap of all pgrp and system() usage We hereby no longer try to manipulate process groups in any way. We don't set a private process group, and we never kill() our entire group either. Instead of using system(), we now have a stap_system() which saves the child PID, so when we get a terminating signal we can pass it along to the child. Signals sent through the TTY have always worked, since the TTY sends it to the entire pgrp. However, if we're running as part of a wrapper script or GUI, which may not have a separate process group for stap, we still would like to allow "kill -TERM $STAPPID" to terminate stap nicely. There's still a short window of failure in the time that staprun is active, because we can't kill a setuid process from a user process. Once staprun drops privileges and execs to stapio though, everything should work fine. --- util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index d385be02..7c557049 100644 --- a/util.h +++ b/util.h @@ -13,6 +13,8 @@ void tokenize(const std::string& str, std::vector& tokens, std::string find_executable(const std::string& name); const std::string cmdstr_quoted(const std::string& cmd); std::string git_revision(const std::string& path); +int stap_system(const char *command); +int kill_stap_spawn(int sig); // stringification generics -- cgit