From owner-freebsd-stable@FreeBSD.ORG Wed Sep 22 11:20:03 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26213106564A for ; Wed, 22 Sep 2010 11:20:03 +0000 (UTC) (envelope-from bartsch@dssgmbh.de) Received: from mail.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id D8CB58FC17 for ; Wed, 22 Sep 2010 11:20:02 +0000 (UTC) Received: from localhost (inetmail.dmz [10.3.0.3]) by mail.incore.de (Postfix) with ESMTP id AA90D6503B; Wed, 22 Sep 2010 13:01:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from mail.incore.de ([10.3.0.3]) by localhost (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id 4AKA96f+KjOT; Wed, 22 Sep 2010 13:01:16 +0200 (CEST) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by mail.incore.de (Postfix) with ESMTP id 890CD65031; Wed, 22 Sep 2010 13:01:16 +0200 (CEST) Received: from pcbart.incore (pcbart.incore [192.168.0.57]) by mail.incore (Postfix) with ESMTPA id 7F94145085; Wed, 22 Sep 2010 13:01:16 +0200 (CEST) Message-ID: <4C99E1FC.2000902@dssgmbh.de> Date: Wed, 22 Sep 2010 13:01:16 +0200 From: Alfred Bartsch User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: "S.N.Grigoriev" References: <4C7D01F7.4010003@zirakzigil.org> <265911284972128@web78.yandex.ru> <4C972B3E.2050108@tefre.com> <14311284977257@web78.yandex.ru> In-Reply-To: <14311284977257@web78.yandex.ru> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: How to terminate a lot of jails correctly X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 11:20:03 -0000 S.N.Grigoriev wrote: > > 20.09.10, 13:37, "Erik Stian Tefre" : > >>> I use a server (FreeBSD 8.1R amd64) with two dozens of jails configured. >> > I've found out that only a few of them are terminated normally (via >> > /etc/rc.shutdown) during the system shutdown. FreeBSD reports that >> > 20sec interval has elapsed and simply kills all the jails that are not yet >> > terminated. I would like to know in what way can I fix it using the system >> > tools only (not ezjail, Qjail etc). >> >> Increasing rcshutdown_timeout in /etc/rc.conf may help. The default >> value is set to 30 seconds in /etc/defaults/rc.conf. >> > > Erik, > > thank you for your tip. The only drawback of that approche is absence of > ability to calculate a timeout. Try and error only. > to avoid such trial and error, we always set 'rcshutdown_timeout=""' in /etc/rc.conf on all our servers. "man init" reads: When shutting down the machine, init will try to run the /etc/rc.shutdown script. This script can be used to cleanly terminate specific programs such as innd (the InterNetNews server). If this script does not terminate within 120 seconds, init will terminate it. The timeout can be configured via the sysctl(8) variable kern.init_shutdown_timeout. So disabling the variable 'rcshutdown_timeout' should expand the timeout of every single rc-script to a total of 2 minutes for all rc-scripts. If this is not sufficient, try increasing "kern.init_shutdown_timeout". -- Alfred Bartsch