0

When I execute

dd if=/dev/zero of=/dev/null

Then close terminal window i see that dd still running and it's PPID is difference than first time. What is happening for dd process ?

whenever killing parent process kill the child process?

1 Answer 1

3

Closing an interactive non-login terminal (such as a terminal window in Gnome or kde) won't send a SIGHUP signal. You can change that behavior in other type of shell (via a huponexit option) but not in interactive non-login term's. See https://askubuntu.com/a/685291/798765 for more details on huponexit ;)

5
  • As for the PPID, does it become the same as upstart's PID (on mobile right now, cant try myself) ? See Kos' comment on the answer above Feb 25, 2018 at 17:42
  • I think the process is re-parented to the init (pid 1) process in this case. Nowadays that's systemd.
    – PerlDuck
    Feb 25, 2018 at 17:51
  • But it's parent is killed! How does the child is allive?
    – Sinoosh
    Feb 26, 2018 at 3:57
  • 1
    @Sinoosh: Child processes aren't killed upon their parents' death by default. Feb 26, 2018 at 19:48
  • @Sinoosh See stackoverflow.com/a/21869303 and man kill ("negatives PID values may be used to choose whole process groups(...)") Feb 27, 2018 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .