From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1193 Path: news.gmane.org!not-for-mail From: Richard Downing Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Runit on tty1 Date: Thu, 06 Jul 2006 08:02:25 +0100 Message-ID: <44ACB581.8080308@langside.org.uk> References: <449C4064.6050504@langside.org.uk> <20060705161102.GA17911@oss.co.yu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152169472 17175 80.91.229.2 (6 Jul 2006 07:04:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 07:04:32 +0000 (UTC) Original-X-From: supervision-return-1429-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Jul 06 09:04:24 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1FyNuL-00058R-UF for gcsg-supervision@gmane.org; Thu, 06 Jul 2006 09:04:18 +0200 Original-Received: (qmail 22441 invoked by uid 76); 6 Jul 2006 07:04:39 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 22436 invoked from network); 6 Jul 2006 07:04:39 -0000 User-Agent: Thunderbird 1.5.0.2 (X11/20060425) Original-To: supervision@list.skarnet.org In-Reply-To: <20060705161102.GA17911@oss.co.yu> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1193 Archived-At: 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 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds