From owner-freebsd-bugs Tue Apr 23 5:10:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0D02B37B41B for ; Tue, 23 Apr 2002 05:10:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3NCA3p43680; Tue, 23 Apr 2002 05:10:03 -0700 (PDT) (envelope-from gnats) Date: Tue, 23 Apr 2002 05:10:03 -0700 (PDT) Message-Id: <200204231210.g3NCA3p43680@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: conf/37370: Serial drainwait shouldn't be zero (forever) by default Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR conf/37370; it has been noted by GNATS. From: Bruce Evans To: "Daniel O'Connor" Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: conf/37370: Serial drainwait shouldn't be zero (forever) by default Date: Tue, 23 Apr 2002 22:10:05 +1000 (EST) On Tue, 23 Apr 2002, Daniel O'Connor wrote: > >Description: > With the default it seems very easy to get a process stuck forever (say connected to a UPS) > > >How-To-Repeat: > Not really sure but I have 2 stuck apcsmart processes on machines I would rather not reboot. > > >Fix: > > Apply http://www.gsoft.com.au/~doconnor/sensible-drainwait.diff This just breaks default(). From the non-broken rc.serial: > default() { > # Reset everything changed by the other functions to initial defaults. ^^^^^^^ > ... > comcontrol /dev/tty${ci}${i} dtrwait 300 drainwait 0 ^^^ ^ The initial defaults are determined by the driver, not by rc.serial. The default for drainwait is known to be 0, since any other value would break POSIX conformance. The default for dtrwait is not so well known; the value of 300 is just sio's rather arbitrary value. Actual fix: use values suitable for your application and/or hardware. I often use 1 for drainwait to unwedge terminals as fast as possible, and notice the problems from the non-POSIX-conformance of this when I forget to change it back to a reasonable value. Any nonzero value is just broken if normal draining for some reason takes longer. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message