Hi Oleg. Attaching the fixed patch. Changes: - in wait_task_consider(), pr_detach hides the process only in !ptrace case - reparenting within the group is no longer re-enables detaching - in do_notify_parent_cldstop(), do not allow notifications of real_parent (still allow for ptrace parent) - scared by your question about reparenting, I reserved the flags argument for the future extensions. :) Reparenting may depend on a flag. The attached patch implements the PR_DETACH prctl command. It detaches the entire process group from its parent, allowing the parent to still read the detach code with normal wait(). Can be used to daemonize process with threads.