From owner-freebsd-questions@FreeBSD.ORG Sat Oct 9 21:23:39 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CFCA16A4CE for ; Sat, 9 Oct 2004 21:23:39 +0000 (GMT) Received: from o2.hostbaby.com (o2.hostbaby.com [208.187.29.121]) by mx1.FreeBSD.org (Postfix) with SMTP id 18E5B43D1D for ; Sat, 9 Oct 2004 21:23:39 +0000 (GMT) (envelope-from ceo@l-i-e.com) Received: (qmail 39113 invoked by uid 1001); 9 Oct 2004 21:23:42 -0000 Received: from 67.167.52.21 (SquirrelMail authenticated user ceo@l-i-e.com); by www.l-i-e.com with HTTP; Sat, 9 Oct 2004 14:23:42 -0700 (PDT) Message-ID: <1315.67.167.52.21.1097357022.squirrel@www.l-i-e.com> Date: Sat, 9 Oct 2004 14:23:42 -0700 (PDT) From: "Richard Lynch" To: freebsd-questions@freebsd.org User-Agent: Hostbaby Webmail X-Mailer: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: stdout/stderr/??? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ceo@l-i-e.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 21:23:39 -0000 I have a situation where NIC code printf's out stuff. I'd *LIKE* to collect that output. Under Linux, I'd use 2&>1 I read somewhere that under FreeBSD, I could do: (xxx > log.out) &> log.err This works fine for xxx == make buildkernel If fails miserably for xxx == ifconfig, however. I can sorta get what I want by starting X-Windows, and using a terminal/shell to do the command. Then the messages I desire to log are A) suppressed from by shell (which is BAD) but B) logged into /var/log/messages (which is close enough to what I want) Alas, the real problem comes when my driver code sends the machine into an infinite loop, spewing out messages so fast I can't even read them, and the only way out is to forcibly power-off the laptop by removing battery and power cord. Upon re-boot, the additions I would expect in /var/log/messages (or the bziped older logs) do not contain the messages I need to see. I have also tried: ktrace xxx Again, for the case where the machine is not in an infinite loop, it works real nifty; But when I'm forced to chop power, I get nothing. Is there something that will: A) copy (or re-direct) all output somewhere, *AND* B) force it to be synchronous and unbuffered and whatever else has to occur to get the file to be saved? Any other suggestions for how to get this process to not lock up the machine? control-C ineffective CTRL-ALT-F2 followed by CTRL-ALT-DELETE can sometimes get me to another tty, but that tty does not accept input Hmmmm. Perhaps I should try to cron a "killall ifconfig" for shortly after the command I'm about to type... Or something like: ifconfig ...&; sleep 3; killall ifconfig Any other ideas? Please cc me, I'm so far behind on reading -questions that I've unsubscribed until I catch up... -- Like Music? http://l-i-e.com/artists.htm