supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Richard Downing <richard@langside.org.uk>
Subject: Re: Runit on tty1
Date: Thu, 06 Jul 2006 08:02:25 +0100	[thread overview]
Message-ID: <44ACB581.8080308@langside.org.uk> (raw)
In-Reply-To: <20060705161102.GA17911@oss.co.yu>

Milan P. Stanic wrote:
> On Wed, Jul 05, 2006 at 11:08:02AM -0400, Charlie Brady wrote:
>> On Fri, 23 Jun 2006, Richard A Downing FBCS CITP wrote:
>>
>>> I have just built a new system (glibc-2.4, gcc04.1.1, linux-2.6.17.1)
>>> with runit-1.5.1.
>>> This seems to be quite stable except that tty1 does not accept ctrl-c -
>>> indeed if /etc/runit/ctrlaltdel exists, this is run when ctrl-c is
>>> pressed on tty1 (and causes a reboot as expected).
>> What are you running on tty1 and how is it started?
> 
> I missed the beginning of thread so I'm writing here.
> 
> I noticed the same behavior when I switched to Linux 2.6.17
> I tried with runit 1.3.1 and 1.5.1 but the behavior is same.
> When I revert to Linux 2.6.15 all is OK.
> 
> Must be that the something is changed in Linux kernel but I didn't have
> time to look at it.
> 
> Also, when is user logged on tty1 most non-alpha keys (TAB, arrows ...)
> does not work in shell.
> 

Yes, this is correct.  My other machines (all x86) exhibit the same 
behaviour when they are up?graded to 2.6.17 kernels.

Looks like something has changed in the ABI with regards to setsid() or 
the TIOCSCTTY ioctl, But I regret that I'm not programmer enough any 
more to be able to diagnose it.

Note this in the changelog for 2.6.17, it might relate to it:

commit 390e2ff07712468ce6600a43aa91e897b056ce12
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Fri Mar 31 02:31:33 2006 -0800

     [PATCH] Make setsid() more robust

     The core problem: setsid fails if it is called by init.  The effect 
in 2.6.16
     and the earlier kernels that have this problem is that if you do a 
"ps -j 1 or
     ps -ej 1" you will see that init and several of it's children have 
process
     group and session == 0.  Instead of process group == session == 1. 
  Despite
     init calling setsid.

     The reason it fails is that daemonize calls set_special_pids(1,1) 
on kernel
     threads that are launched before /sbin/init is called.

     The only remaining effect in that current->signal->leader == 0 for init
     instead of 1.  And the setsid call fails.  No one has noticed because
     /sbin/init does not check the return value of setsid.

     In 2.4 where we don't have the pidhash table, and daemonize doesn't 
exist
     setsid actually works for init.

     I care a lot about pid == 1 not being a special case that we leave 
broken,
     because of the container/jail work that I am doing.

     - Carefully allow init (pid == 1) to call setsid despite the kernel 
using
       its session.

     - Use find_task_by_pid instead of find_pid because find_pid taking a
       pidtype is going away.

     Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
     Signed-off-by: Andrew Morton <akpm@osdl.org>
     Signed-off-by: Linus Torvalds <torvalds@osdl.org>


  reply	other threads:[~2006-07-06  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 19:26 Richard A Downing FBCS CITP
2006-06-30  9:10 ` Richard Downing
2006-06-30  9:27   ` Gerrit Pape
2006-07-05 15:08 ` Charlie Brady
2006-07-05 16:11   ` Milan P. Stanic
2006-07-06  7:02     ` Richard Downing [this message]
2006-09-21  5:59 Zachary Kotlarek
2006-09-21 13:57 ` Richard Downing

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=44ACB581.8080308@langside.org.uk \
    --to=richard@langside.org.uk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).