Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 2010 13:01:16 +0200
From:      Alfred Bartsch <bartsch@dssgmbh.de>
To:        "S.N.Grigoriev" <serguey-grigoriev@yandex.ru>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: How to terminate a lot of jails correctly
Message-ID:  <4C99E1FC.2000902@dssgmbh.de>
In-Reply-To: <14311284977257@web78.yandex.ru>
References:  <4C7D01F7.4010003@zirakzigil.org>	<265911284972128@web78.yandex.ru> <4C972B3E.2050108@tefre.com> <14311284977257@web78.yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
S.N.Grigoriev wrote:
> 
> 20.09.10, 13:37, "Erik Stian Tefre" <erik@tefre.com>:
> 
>>> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C99E1FC.2000902>