From owner-freebsd-hackers Fri Aug 9 10:56:23 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7427837B400 for ; Fri, 9 Aug 2002 10:56:21 -0700 (PDT) Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E8D943E6E for ; Fri, 9 Aug 2002 10:56:21 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0438.cvx22-bradley.dialup.earthlink.net ([209.179.199.183] helo=mindspring.com) by gull.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17dDzi-0004ZF-00; Fri, 09 Aug 2002 10:56:14 -0700 Message-ID: <3D54020A.C4D1F405@mindspring.com> Date: Fri, 09 Aug 2002 10:55:22 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Dan Langille Cc: hackers@freebsd.org Subject: Re: serial console com1 to com1 == login race condition? References: <3D53B3E5.5384.276CA6F0@localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dan Langille wrote: > I have two remote boxes. My colocation hosts have strung a crossover > serial cable from com1 to com1 on these boxes. The idea is that if I > paint myself into a corner on one box, I can get access to it from > the other box via the serial cable. > > But... > > I will need to set up serial consoles on each box in advance of a > problem arising. But won't I get a race condition with each box > thinking the other is trying to login? The historical fix for this problem is to not emit a banner or login until you get two CR's within a small time window. It is the banner/login that triggers the mutual login attempts. Usually, this is a getty hack. I believe vgetty and mgetty can do this (the initial system greeting and login banner comes from getty). You *must* have modem control, e.g. HUPCL, so that exiting the com program has the effect of resetting the other end to getty, rather than leaving it logged in, etc.. If these are actually consoles, then you are probably already screwed, since there will be a lot of spew with CR/LF all over the place. If you are willing to hack the driver, then you can make sure you are not sending DTR to the other side unless you open with a modified cu/tip program that has to do an explicit ioctl to turn it on to the other end. One incredibly -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message