Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2004 17:04:34 -0400
From:      Alex Vasylenko <lxv@omut.org>
To:        Kirk Strauser <kirk@strauser.com>
Cc:        current@freebsd.org
Subject:   Re: Why the 30-second pause after executing this script?
Message-ID:  <407B0462.9040405@omut.org>
In-Reply-To: <87wu4pnxs0.fsf__29819.4997165867$1081558708@strauser.com>
References:  <87wu4pnxs0.fsf__29819.4997165867$1081558708@strauser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?407B0462.9040405>