From owner-freebsd-current@FreeBSD.ORG Fri Apr 9 17:57:53 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BDD216A4CE for ; Fri, 9 Apr 2004 17:57:53 -0700 (PDT) Received: from kanga.honeypot.net (kanga.honeypot.net [208.162.254.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 979D343D39 for ; Fri, 9 Apr 2004 17:57:52 -0700 (PDT) (envelope-from kirk@strauser.com) Received: from pooh.strauser.com (pooh.honeypot.net [10.0.5.128]) by kanga.honeypot.net (8.12.11/8.12.11) with ESMTP id i3A0voo9010484 for ; Fri, 9 Apr 2004 19:57:51 -0500 (CDT) (envelope-from kirk@strauser.com) Resent-Message-Id: <200404100057.i3A0voo9010484@kanga.honeypot.net> Resent-To: freebsd-current@freebsd.org Resent-From: Kirk Strauser Resent-Date: Fri, 09 Apr 2004 19:57:49 -0500 To: freebsd-questions@freebsd.org From: Kirk Strauser Date: Fri, 09 Apr 2004 07:25:35 -0500 Message-ID: <87wu4pnxs0.fsf@strauser.com> X-Mailer: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Lines: 67 X-Virus-Scanned: clamd / ClamAV version devel-20040331, clamav-milter version 0.70a Subject: Why the 30-second pause after executing this script? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2004 00:57:53 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable One of my programs (plug: JailAdmin! Stays crunchy in milk!) uses 'jexec' to attach to a jail to execute /etc/rc.shutdown. I've noticed that this works as expected, unless its output is being piped into another program, in which case 'sh' waits about 30 seconds after the 'exit 0' line is executed before closing its end of the pipe. For example: The command dumping to STDOUT: root@kanga:/tmp# time jexec 8 sh -x /etc/rc.shutdown + stty status ^T + trap : 2 + trap : 3 ... + kill -TERM 80521 Terminated + echo . . + exit 0 real 0m0.575s user 0m0.043s sys 0m0.195s The command dumping to a pipe: root@kanga:/tmp# time jexec 8 sh -x /etc/rc.shutdown | cat + stty status ^T + trap : 2 + trap : 3 ... + kill -TERM 80638 Terminated + echo . . + exit 0 real 0m30.049s user 0m0.070s sys 0m0.162s I'm at a loss. Why would this be? Are there workarounds? =2D-=20 Kirk Strauser "94 outdated ports on the box, 94 outdated ports. Portupgrade one, an hour 'til done, 82 outdated ports on the box." --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBAdpZI5sRg+Y0CpvERAneFAJ9r27HdczVOpcxIlDPEJhokUAzjoACfX2GK xv7LQOUQnv4FrXfaDncJO/c= =hUI1 -----END PGP SIGNATURE----- --=-=-=--