Example where the subprocess 115576 has not been terminated:
root@ubuntu:~/sudebug/src/shadow-4.1.5.1/src# pkill sleep; ./su test -c 'sleep 9999'&
[1] 115575
root@ubuntu:~/sudebug/src/shadow-4.1.5.1/src# kill $!
root@ubuntu:~/sudebug/src/shadow-4.1.5.1/src# ...waiting for child to terminate.
pgrep sleep
115576
[1]+ Exit 255 ./su test -c 'sleep 9999'
root@ubuntu:~/sudebug/src/shadow-4.1.5.1/src# pgrep sleep
115576
Example where the subprocess 115576 has not been terminated: ~/sudebug/ src/shadow- 4.1.5.1/ src# pkill sleep; ./su test -c 'sleep 9999'& ~/sudebug/ src/shadow- 4.1.5.1/ src# kill $! ~/sudebug/ src/shadow- 4.1.5.1/ src# ...waiting for child to terminate. ~/sudebug/ src/shadow- 4.1.5.1/ src# pgrep sleep
root@ubuntu:
[1] 115575
root@ubuntu:
root@ubuntu:
pgrep sleep
115576
[1]+ Exit 255 ./su test -c 'sleep 9999'
root@ubuntu:
115576
Expected behavior: ~/sudebug/ src/shadow- 4.1.5.1/ src# pkill sleep; ./su test -c 'sleep 9999' & ~/sudebug/ src/shadow- 4.1.5.1/ src# kill $! ~/sudebug/ src/shadow- 4.1.5.1/ src#
root@ubuntu:
[1] 115503
root@ubuntu:
root@ubuntu:
Session terminated, terminating shell... ...terminated.
...terminated.
[1]+ Exit 143 ./su test -c 'sleep 9999' ~/sudebug/ src/shadow- 4.1.5.1/ src# pgrep sleep
root@ubuntu: