Debian Bug report logs - #655310
getty fails when consoles are on devpts

version graph

Package: util-linux; Maintainer for util-linux is LaMont Jones <lamont@debian.org>; Source for util-linux is src:util-linux (PTS, buildd, popcon).

Reported by: Serge Hallyn <serge.hallyn@canonical.com>

Date: Tue, 10 Jan 2012 09:15:01 UTC

Severity: normal

Found in version util-linux/2.20.1-1.1

Done: Serge Hallyn <serge.hallyn@canonical.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, LaMont Jones <lamont@debian.org>:
Bug#655310; Package util-linux. (Tue, 10 Jan 2012 09:15:05 GMT) (full text, mbox, link).


Acknowledgement sent to Serge Hallyn <serge.hallyn@canonical.com>:
New Bug report received and forwarded. Copy sent to LaMont Jones <lamont@debian.org>. (Tue, 10 Jan 2012 09:15:07 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Serge Hallyn <serge.hallyn@canonical.com>
To: submit@bugs.debian.org
Subject: getty fails when consoles are on devpts
Date: Tue, 10 Jan 2012 10:12:56 +0100
Package: util-linux
Version: 2.20.1-1.1

Hi,

lxc guests run getty on /dev/pts/ entries (which are bind mounted onto
/dev/console and /dev/tty{1-4} in the guest).  The latest util-linux
makes some changes (in particular commit
3aa6b68f7e19fa3e1c2bba75bee921a98b7b46af) which cause this to fail, due
to three log_errs() which exit on what are non-fatal errors in this
case.  The recent upstream commit
1593b134ebf596ae7a2b1e73f2dcc8c4e7febddd "agetty: don't use log_err()
for non-fatal errors" fixes two of these.  A third is after a call to
tcsetpgrp.  Both patches are appended here.  With both patches applied,
getty works for me in lxc.

{{{{{{{{{{{{{{{{{{{{{  patch 1 }}}}}}}}}}}}}}}}}}}}}
commit 1593b134ebf596ae7a2b1e73f2dcc8c4e7febddd
Author: Karel Zak <kzak@redhat.com>
Date:   Thu Dec 8 11:39:05 2011 +0100

    agetty: don't use log_err() for non-fatal errors
    
    The TIOCSCTTY ioctl requires that caller is session leader -- so it
    depends on initd (or we have to add setsid() to aggety). It seems that the
    traditional way is to setup tty in agetty and session in login(1).
    
    It means that all session related things (TIOCSCTTY, vhangup, ...) in the
    command agetty should be optional. (Note that vhangup() is called when
    --hangup is explicitly specified on command line, so log_err() makes
    sense there.)
    
    Reported-by: Andrew Walrond <andrew@walrond.org>
    Signed-off-by: Karel Zak <kzak@redhat.com>

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 079a737..3500a8e 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -925,7 +925,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
 
 		if (((tid = tcgetsid(fd)) < 0) || (pid != tid)) {
 			if (ioctl(fd, TIOCSCTTY, 1) == -1)
-				log_err("/dev/%s: cannot get controlling tty: %m", tty);
+				log_warn("/dev/%s: cannot get controlling tty: %m", tty);
 		}
 
 		if (op->flags & F_HANGUP) {
@@ -950,7 +950,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
 			log_err(_("/dev/%s: cannot open as standard input: %m"), tty);
 		if (((tid = tcgetsid(STDIN_FILENO)) < 0) || (pid != tid)) {
 			if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) == -1)
-				log_err("/dev/%s: cannot get controlling tty: %m", tty);
+				log_warn("/dev/%s: cannot get controlling tty: %m", tty);
 		}
 
 	} else {
{{{{{{{{{{{{{{{{{{{{{  patch 2 }}}}}}}}}}}}}}}}}}}}}
Index: util-linux-2.20.1/term-utils/agetty.c
===================================================================
--- util-linux-2.20.1.orig/term-utils/agetty.c	2012-01-10 08:55:42.763054760 +0000
+++ util-linux-2.20.1/term-utils/agetty.c	2012-01-10 08:56:36.755053680 +0000
@@ -949,7 +949,7 @@
 	}
 
 	if (tcsetpgrp(STDIN_FILENO, pid))
-		log_err("/dev/%s: cannot set process group: %m", tty);
+		log_warn("/dev/%s: cannot set process group: %m", tty);
 
 	/* Get rid of the present outputs. */
 	close(STDOUT_FILENO);




Reply sent to Serge Hallyn <serge.hallyn@canonical.com>:
You have taken responsibility. (Thu, 19 Jan 2012 21:07:13 GMT) (full text, mbox, link).


Notification sent to Serge Hallyn <serge.hallyn@canonical.com>:
Bug acknowledged by developer. (Thu, 19 Jan 2012 21:07:39 GMT) (full text, mbox, link).


Message #10 received at 655310-done@bugs.debian.org (full text, mbox, reply):

From: Serge Hallyn <serge.hallyn@canonical.com>
To: 655310-done@bugs.debian.org
Subject: Can no longer reproduce
Date: Thu, 19 Jan 2012 15:02:13 -0600
Sorry, for reasons I cannot explain, I can no longer reproduce this bug.




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 17 Feb 2012 07:33:12 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 12 21:38:45 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.