Sudo ignoring SIGTERM unless connected to strace
Knut Aksel Røysland <[email protected]> Sat, 5 Nov 2022 23:44:16 +0000
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am trying to understand how I can get Sudo to handle SIGTERM in the following scenario: #!/usr/bin/bash set -x sudo -n sleep infinity & jobs sleep 5 jobs -p | sudo -n xargs -r kill -TERM wait What I am observing is that SIGTERM is ignored, so that "wait" hangs forever. I discovered that if I connect strace to the Sudo process during the 5 seconds before SIGTERM is sent, using: sudo strace -p $(pidof sudo) in a different terminal, then Sudo behaves as expected. This makes me feel my Bash script is fine, but something surprising is going on inside Sudo. System information: Sudo 1.9.12rc3 Ubuntu 20.04 Linux 5.4.0-131-generic I hope someone here can help me understand what is going on, and help me get to the behavior I want without needing strace. -- Regards, Knut Aksel Røysland ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users