Is it correct that a shell can send signals only to its jobs, but can't send signals to processes which are not its jobs?
disownmoves a job out of the job list of a shell. Does that mean a disowned process will not receive all the signals (not just SIGHUP) from its parent shell? If it will still receives other signals, why so?
Add a comment |
2 Answers
You can always send signals to any process you own. The shell presumably won't on it's own.
- Thanks. I forgot to say I am only talking about signals sent from the parent shell. So the shell won't send any signal to a disowned process, not just SIGHUP?Tim– Tim2016-02-28 23:28:36 +00:00Commented Feb 28, 2016 at 23:28
Easy to test:
sleep will die if it receives SIGUSR1:
$ sleep 999 & [1] 7399 $ kill -USR1 7399 $ [1]+ User defined signal 1 sleep 999 So let's disown it and see if it survives:
$ sleep 999 & [1] 7396 $ disown %1 $ jobs $ ps -fp 7396 UID PID PPID C STIME TTY TIME CMD schaller 7396 7360 0 19:59 pts/0 00:00:00 sleep 999 $ kill -USR1 7396 $ ps -fp 7396 UID PID PPID C STIME TTY TIME CMD $