mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wedgwood <cw@f00f.org>
To: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: koke@amedias.org, linux-kernel@vger.kernel.org,
	Andries Brouwer <aeb@cwi.nl>
Subject: Re: strange delays on console logouts (tty != 1)
Date: Sat, 1 May 2004 16:44:44 -0700	[thread overview]
Message-ID: <20040501234444.GA24120@taniwha.stupidest.org> (raw)
In-Reply-To: <20040501232448.GA4707@vana.vc.cvut.cz>

On Sun, May 02, 2004 at 01:24:48AM +0200, Petr Vandrovec wrote:

> I do not think that it is init...

No, it's not.

> (1) agetty (at least from util-linux 2.12 from current debian
> unstable) opens /dev/console and calls VT_OPENQRY to find first
> unopened VT.

yes, this i discovered too

> I have no idea why it does this, especially as it causes problems
> when more than one agetty is started simultaneously. I cannot
> believe that there is no better way how to detect whether tty is in
> use or not (as comment in the agetty suggests).

read below

> (2) tty hangup is scheduled for work_queue.

> (3) when you have bad luck then scheduled hangup work runs AFTER
> newly created agetty calls VT_OPENQRY, and you get an error that
> ttyX is already in use...

Unless I misunderstand you, I'm not conviced... it get tty's 'stuck',
they never come right even after hours or days.

> I think that we should concentrate on how is it possible that init
> can spawn agetty and agetty can parse whole /var/run/utmp, open
> /dev/console and issue VT_OPENQRY before work scheduled before init
> was even notified is done. It looks to me like that someone
> schedules some job on the workqueue although that job apparently
> deserves its own kernel thread due to time it takes.

Yes, as far as the kernel is concerned this needs checking.

By comments (from before I got this email) and a pointer to the fix I
use...


I see unused tty's (such as tty4) and ioctl(..., VT_OPENQRY, ...)
returning numbers like 8 --- which agetty barfs on.

The solution I hacked up was to have agetty use vhangup on the tty and
not even use the ioctl which seems fragile at the best of time.  The
present patch is at:

	http://stupidest.org/patches/util-linux-2.12-agetty-vhangup.001.patch

(ugly URL, sorry about that).

I've cc'd Andries Brouwer his his comments as he is the util-linux
maintainer.



Thanks,

  --cw

  reply	other threads:[~2004-05-01 23:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-30 19:53 Jorge Bernal
2004-05-01 21:46 ` Chris Wedgwood
2004-05-01 23:24   ` Petr Vandrovec
2004-05-01 23:44     ` Chris Wedgwood [this message]
2004-05-02  0:36       ` Petr Vandrovec
2004-05-02  0:45         ` Chris Wedgwood
2004-05-02 13:54       ` Andries Brouwer
2004-05-02  1:03     ` Andrew Morton
2004-05-02  8:00       ` Russell King
2004-05-02  8:13         ` Andrew Morton
2004-05-02  8:17           ` Russell King
2004-05-02  9:37             ` Russell King
2004-05-02 10:17               ` Russell King
2004-05-02 12:01                 ` Petr Vandrovec
2004-05-02 17:53                 ` Chris Wedgwood
2004-05-02 18:01                   ` Russell King
2004-05-02 18:04                   ` Russell King
2004-05-02 18:19                     ` Chris Wedgwood
2004-05-01 22:20 ` Chris Wedgwood
2004-05-02  0:26   ` Jorge Bernal

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=20040501234444.GA24120@taniwha.stupidest.org \
    --to=cw@f00f.org \
    --cc=aeb@cwi.nl \
    --cc=koke@amedias.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vandrove@vc.cvut.cz \
    /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

all inboxes | Powered by JetHome®