Bugzilla – Bug 808
iolog terminate process sent to background
Last modified: 2017-12-01 14:08:20 MST
Created attachment 502 [details] replicator 1/2 With log_output set, a process sent to background may fail to start. I was able to replicate the bug with the latest sudo version available. Adding a sleep after the background process start, the process does start. daniele@build-jessie-amd64:~$ ./replicator.sh env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, log_output, log_output, maxseq=150, iolog_dir=/var/log/sudo-io/%{user}, !requiretty /usr/bin/iperf3 running KO test no sleep iperf3 KO iperf3: no process found running OK test sleeping 3s iperf3 KO iperf3: no process found daniele@build-jessie-amd64:~$ To replicate the problem please just deploy the two script in the same folder and run ./replicator.sh. Ensure that the user (even root) may run sudo ./iperf-daemon.sh
Created attachment 503 [details] replicator 2/2
Forgot to mention that i have used the latest bits from sudo.ws. daniele@build-jessie-amd64:~$ sudo -V Sudo version 1.8.21p2 Sudoers policy plugin version 1.8.21p2 Sudoers file grammar version 46 Sudoers I/O plugin version 1.8.21p2 daniele@build-jessie-amd64:~$
When I/O logging is enabled, if the process run by sudo exits, the pseudo-tty will be closed. As a result of this, any process with the tty open will receive SIGHUP. In your example, when the iperf-daemon.sh scripts exits, iperf3 receives SIGHUP and exits. If you run iperf3 like this: iperf3 -s </dev/null >/dev/null 2>&1 & or better yet: iperf3 -s -D you will not have this problem.
*** This bug has been marked as a duplicate of bug 502 ***