From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 14:04:43 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 D486916A4E5 for ; Mon, 12 Apr 2004 14:04:43 -0700 (PDT) Received: from mail.omut.org (mail.omut.org [216.218.215.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0CC643D4C for ; Mon, 12 Apr 2004 14:04:43 -0700 (PDT) (envelope-from lxv@omut.org) Received: from omut.org (bullfrog.intranet [10.10.10.26]) (authenticated bits=0) by mail.omut.org (8.12.11/8.12.11) with ESMTP id i3CL4ZsL024813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Apr 2004 14:04:42 -0700 (PDT) (envelope-from lxv@omut.org) Message-ID: <407B0462.9040405@omut.org> Date: Mon, 12 Apr 2004 17:04:34 -0400 From: Alex Vasylenko User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kirk Strauser References: <87wu4pnxs0.fsf__29819.4997165867$1081558708@strauser.com> In-Reply-To: <87wu4pnxs0.fsf__29819.4997165867$1081558708@strauser.com> Content-Type: multipart/mixed; boundary="------------090501070907030705050802" X-Scanned-By: MIMEDefang 2.42 cc: current@freebsd.org Subject: Re: 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: Mon, 12 Apr 2004 21:04:43 -0000 This is a multi-part message in MIME format. --------------090501070907030705050802 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Kirk Strauser wrote: > 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: /etc/rc.shutdown kills the _shell_ of the watchdog timer instead of the timer itself, so the timer keeps going. Please try the patch attached. -- Alex. --------------090501070907030705050802 Content-Type: text/plain; name="rc.shutdown.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rc.shutdown.diff" Index: etc/rc.shutdown =================================================================== RCS file: /home/ncvs/src/etc/rc.shutdown,v retrieving revision 1.25 diff -u -r1.25 rc.shutdown --- etc/rc.shutdown 8 Jul 2003 02:52:14 -0000 1.25 +++ etc/rc.shutdown 12 Apr 2004 20:55:51 -0000 @@ -66,7 +66,7 @@ _rcshutdown_watchdog= if [ -n "$rcshutdown_timeout" ]; then debug "Initiating watchdog timer." - sleep $rcshutdown_timeout && ( + exec sleep $rcshutdown_timeout && ( _msg="$rcshutdown_timeout second watchdog" \ " timeout expired. Shutdown terminated." logger -t rc.shutdown "$_msg" --------------090501070907030705050802--