From owner-freebsd-bugs Tue Apr 23 5:50:56 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 D2F5637B41B for ; Tue, 23 Apr 2002 05:50:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3NCo2P58444; Tue, 23 Apr 2002 05:50:02 -0700 (PDT) (envelope-from gnats) Date: Tue, 23 Apr 2002 05:50:02 -0700 (PDT) Message-Id: <200204231250.g3NCo2P58444@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:49:51 +1000 (EST) On Tue, 23 Apr 2002, Bruce Evans wrote: > 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. Oops, the change only "breaks" default() in non-current versions of FreeBSD. The initial default is still 0 in RELENG_4, but in -current it is 300 at boot time and `sysctl kern.drainwait` after boot time. This rarely matters, since if you use /etc/rc.serial at all, then you should only use default() to restore the initial defaults in preparation for changing only some of the defaults using one of the other functions in rc.serial or otherwise. All of the other functions in rc.serial except mouse() set drainwait to a more useable value. A timeout might be useful even for mouse(), to recover from the error of setting crtscts on the mouse. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message