LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alan Cox <alan@redhat.com>,
	Davide Libenzi <davidel@xmailserver.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] orphaned pgrp fixes
Date: Fri, 7 Mar 2008 04:52:15 +0300	[thread overview]
Message-ID: <20080307015215.GA149@tv-sign.ru> (raw)
In-Reply-To: <m1y78w1wmr.fsf@ebiederm.dsl.xmission.com>

On 03/05, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
> 
> > I am hopeless, I can't understand orphaned pgrps.
> 
> I will give it a quick try.
> When you login in text mode you get a fresh session (setsid).
> If you are using job control in your shell each job is assigned
> a separate process group (setpgrp).
> 
> The shell and all process groups are in the same session.
> 
> Intuitively a process group is considered orphaned when there is
> are no processes in the session that know about it and can wake it
> up.  The goal is to prevent processes that will never wake up if
> they are stopped with ^Z.
> 
> A process is defined as knowing about a process in a process group
> when it is a parent of that process.

Thanks Eric. This does help.

Stupid question, just to be sure. Suppose that SIGTSTP was sent by a
"regular" kill_pid_info() (not by tty or kill_pgrp_info). In that case
get_signal_to_deliver() still must check is_current_pgrp_orphaned(),
yes?

> The task_tgid_nr_ns(p->real_parent, p->nsproxy->pid_ns) == 1 check is
> the proper check, as it handles namespaces properly.  If we need to
> retain it.
>
> I don't believe we need to retain the check for init at all. sysvinit
> doesn't use that feature and I would be surprised if any other init
> did.  Except for covering programming bugs which make testing harder
> I don't see how a version of init could care.
> 
> Further as init=/bin/bash is a common idiom for getting into a
> simplified system and debugging it, there is a case for job control
> to work properly for init.   Unless I am misreading things the check 
> for init prevent us from using job control from our first process.
> Which seems like it would make init=/bin/bash painful if job control
> was ever enabled.
>
> I believe that the only reason with a weird check for init like we are
> performing that we are POSIX compliant is that our init process can
> count as a special system process and can escape the definition.
> 
> Therefore I think the code would be more maintainable, and the system
> would be less surprising, and more useful if we removed this special
> case processing of init altogether.

Looks like a nice changelog for the patch ;)

Oleg.


  reply	other threads:[~2008-03-07  1:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 18:44 Oleg Nesterov
2008-03-04 12:26 ` Roland McGrath
2008-03-04 15:51   ` Oleg Nesterov
2008-03-05  1:11     ` Roland McGrath
2008-03-05 16:48       ` Oleg Nesterov
2008-03-05 17:11   ` Oleg Nesterov
2008-03-06  1:14     ` Eric W. Biederman
2008-03-07  1:52       ` Oleg Nesterov [this message]
2008-03-07  3:53     ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080307015215.GA149@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=alan@redhat.com \
    --cc=davidel@xmailserver.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH 0/3] orphaned pgrp fixes' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).