-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possibility to configure kill_pgid also via environment variable #21
base: main
Are you sure you want to change the base?
Conversation
Can you please rebase this? We have changed the license from GPL-3.0-or-later to GPL-2.0-or-later and we need you to rebase it in order to confirm that you agree with the new license terms. |
Signed-off-by: Michael Rodler <m@mrodler.eu>
@cyphar done. |
@@ -482,6 +482,11 @@ int main(int argc, char **argv) | |||
if (argc < 1 && !run_as_pause) | |||
bail_usage("missing program name"); | |||
|
|||
char *kill_pgid_env = secure_getenv("CATATONIT_KILLPG"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secure_getenv
doesn't make sense in this context -- secure_getenv
is only relevant for setuid binaries (and even then, it only really makes sense for general purpose libraries that might be used by a setuid binary).
if (kill_pgid_env != NULL) { | ||
kill_pgid = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Linux kernel style:
if (kill_pgid_env != NULL) { | |
kill_pgid = true; | |
} | |
if (kill_pgid_env) | |
kill_pgid = true; |
or even just do:
if (kill_pgid_env != NULL) { | |
kill_pgid = true; | |
} | |
kill_pgid |= getenv("CATATONIT_KILLPG") != NULL; |
Sometimes it is inconvenient to pass a command line flag to catatonit, e.g., the
-g
flag. So this PR adds environment variable to configure catatonit to forward signals to the whole process group.