From owner-freebsd-jail@FreeBSD.ORG Thu Jan 14 12:35:28 2010 Return-Path: Delivered-To: jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1692A106568D; Thu, 14 Jan 2010 12:35:28 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id A160F8FC21; Thu, 14 Jan 2010 12:35:27 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2CF17.dip.t-dialin.net [217.226.207.23]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id A96008444CF; Thu, 14 Jan 2010 13:35:21 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 1944E9A579; Thu, 14 Jan 2010 13:35:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1263472518; bh=MWaBjD4NLmOlrC1pihbH4lpMbRjKeIFr6q9Vm/KJkzc=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=Elz9CTj5RE8c09w9Yifk6Wwd6hDTIZYuq0L2KQeuYvgBSXiHM+JI9iLcn7ADIPb3q tS+H1VtLoNFQqErzH12MU/7auGNKFXKE3SLIZ5qoMrDT0zEMaFQ3wldVmnZ5/fb9cJ 7JRCcfUE+NE30WyltiOjSlp72EkncbKN8xiCdRLotkVzvYuc/xZU/PmVpsy0E20nIo 3GHE9UWIuTfnmh51H/MM0QQK5baNz1Pa/PWFw/Mt2Nb8W+5qzH6D7GBMkkcnUv9FL0 cupXtS9G1ZaEpivFf+8FL9YQVS5wxjQ8J+LMBsLx3sW8U6+ozigeIp0GPZUyCkeeSH kGcpXmhd7uDiw== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o0ECZHWc070077; Thu, 14 Jan 2010 13:35:17 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 14 Jan 2010 13:35:16 +0100 Message-ID: <20100114133516.21277ik0pthwdo0s@webmail.leidinger.net> Date: Thu, 14 Jan 2010 13:35:16 +0100 From: Alexander Leidinger To: Remko Lodder References: <20091207080353.66241t4vpmnmrilc@webmail.leidinger.net> <20100105112447.00005e71@unknown> <0f8c4a9c3740e2185582ef1c922835b3.squirrel@www.jr-hosting.nl> In-Reply-To: <0f8c4a9c3740e2185582ef1c922835b3.squirrel@www.jr-hosting.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: A96008444CF.AAAD7 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.44, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1264077323.33897@EP+FlUlVFgUM1AV6kSQafA X-EBL-Spam-Status: No Cc: jail@FreeBSD.org, simon@FreeBSD.org Subject: Re: starting jails in the background & dependencies X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 12:35:28 -0000 Quoting Remko Lodder (from Tue, 5 Jan 2010 11:35:48 +0100): > > On Tue, January 5, 2010 11:24 am, Alexander Leidinger wrote: >> On Mon, 07 Dec 2009 08:03:53 +0100 Alexander Leidinger >> wrote: >> >>> Hi, >>> >>> now that jails are started in the background (which is good, to >> >> I just realized yesterday that it also stops in parallel (in the >> background). This is bad. It may be the case that a jail is not fully >> stopped via the rc scripts when the OS decides to kill the remaining >> processes during a shutdown. >> >> My first reaction is to only allow to start in the background, but >> everything else needs to be serialized. >> >> Any objections or better ideas out there? > I think the best way at this moment is to revert the change ( I can do > that , or someone else, I dont mind ) and think of a better concept. Simon > also mentioned that he didn't like the current way of doing things, so I > kept it in, for possible suggestions. Reverting the change would mean that > the old behaviour at least works and is with what people are used to. We > can then further improve it where needed. What about the following? Just have a look at the principle, I haven't tested it yet. What it does is: - revert back to serial startup by default - allow to only start in the background (jail_parallel_start=YES) - take input from /dev/null: in case a start script inside the jail wants to read from stdin (it shouldn't), it will not switch the process into STOP state (but should generate some message in the application log) Copy&paste, so maybe messed up tabs: ---snip--- Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (Revision 202277) +++ share/man/man5/rc.conf.5 (Arbeitskopie) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2009 +.Dd January 14, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -3472,6 +3472,11 @@ If set to .Dq Li NO , any configured jails will not be started. +.It jail_parallel_start +.Pq Vt bool +If set to +.Dq Li YES +all configured jails will be started in the background (= in parallel). .It Va jail_list .Pq Vt str A space separated list of names for jails. Index: etc/rc.d/jail =================================================================== --- etc/rc.d/jail (Revision 202277) +++ etc/rc.d/jail (Arbeitskopie) @@ -636,7 +636,8 @@ done eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 + \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ +