1
  • 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?

  • disown moves 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?

3

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 Feb 28 '16 at 23:28
1

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
$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.