You can see the same problem with any shell with a command like

(sleep 3 & exec /bin/sleep 6)

because most versions of /bin/sleep do not clean up zombies (here, a
zombie from an inherited child process).

Dash does not consider the existence of a background process a reason to
fork for an external command (that needs to be execve()'ed). Therefore
you may see zombies if you start some background jobs and the final
command is external and does not clean up zombies it did not start
itself. As a workaround you can add a builtin at the end, for example

(sleep 3 & sleep 6; exit $?)

With bash, this does not happen because bash appears to fork always for
an external command unless it is the only thing to be run in the process
at all. However, this policy results in more process creations than
necessary and therefore poorer performance.

POSIX does not appear to say much about whether the shell should allow
commands to inherit child processes in this manner. However, a shell is
definitely not required to fork as much as bash does.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/915158

Title:
  Process is not closing

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/915158/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to