From owner-freebsd-questions@FreeBSD.ORG Fri Apr 9 05:25:42 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 3CADF16A4CE for ; Fri, 9 Apr 2004 05:25:42 -0700 (PDT) Received: from kanga.honeypot.net (kanga.honeypot.net [208.162.254.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5CCB43D31 for ; Fri, 9 Apr 2004 05:25:41 -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 i39CPeqV080925 for ; Fri, 9 Apr 2004 07:25:41 -0500 (CDT) (envelope-from kirk@strauser.com) To: freebsd-questions@freebsd.org From: Kirk Strauser Date: Fri, 09 Apr 2004 07:25:35 -0500 Message-ID: <87wu4pnxs0.fsf@strauser.com> Lines: 53 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" 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-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2004 12:25:42 -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) iD8DBQBAdpZE5sRg+Y0CpvERAoswAJ9nDb9R7FFeRHmSh7ZP1oS9JIGWTQCfV6Ot sY+xJEbK9Oa13GqcZfWjzn8= =NvpU -----END PGP SIGNATURE----- --=-=-=--