From owner-freebsd-jail@FreeBSD.ORG Mon Dec 7 07:04:05 2009 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 4519F1065693 for ; Mon, 7 Dec 2009 07:04:05 +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 AE3CD8FC0C for ; Mon, 7 Dec 2009 07:04:04 +0000 (UTC) Received: from outgoing.leidinger.net (pD954F846.dip.t-dialin.net [217.84.248.70]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 3CF22844F6B; Mon, 7 Dec 2009 08:03:59 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 4C1A812F69C; Mon, 7 Dec 2009 08:03:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1260169434; bh=0XKhvxfZwLehFoXKatRwLfEznqzl7R1USkg24lCqJvg=; h=Message-ID:Date:From:To:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=ehLGVq99T3KJUnuwAE1bi65N7jhUblMRvjmZu4JhzNM6fUGmN5C1c2uA0zWNVGHeh zDrrnWpl7VcuvRkiuFequSBrLgBi94byOyO8nJ7NjyOl/NeRuOl8Z3FgNTFgsWO4jK B8BZm0oBZtvO42VpnBSunH+RbQlUWfoud7kRuZ1m2CyIkBSGEdVOH00D6sm6LnPM07 p51jBQPq+yFQQK+1SFZwLtCd6JjQYBDhHSgnUqZ18GS24V+Xsi3JioKGU64ra+ohhM o7J8CRsxEN5TyVnOc7R4AvL1+CHcoEXKmGaf9HDsXTt0heobOVnGa/VrfhoFAQRMV6 mVlFHN01jdO5g== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id nB773rsd004837; Mon, 7 Dec 2009 08:03:53 +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; Mon, 07 Dec 2009 08:03:53 +0100 Message-ID: <20091207080353.66241t4vpmnmrilc@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 07 Dec 2009 08:03:53 +0100 From: Alexander Leidinger To: remko@freebsd.org, jail@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.5) / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 3CF22844F6B.7DC19 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: 1260774239.80625@S2uAlbPVJyVquHKsoBN4Iw X-EBL-Spam-Status: No Cc: Subject: 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: Mon, 07 Dec 2009 07:04:05 -0000 Hi, now that jails are started in the background (which is good, to prevent that a broken jail causes a good jail not to start), I have to problem how to express dependencies. Scenario: - several jails on the same machine (via ezjail) - one jail depends on the services of another jail, e.g. - jail0 with a DNS server - jailA with mysql (requires that jail0 is up) - jailB needs access to the mysql of the jailA (and DNS of jail0) Currently all jails are started in parallel. This may lead to a situation where something in jailB wants to access jailA before mysql is available. In my case I have the special condition that I need to run a script (rc.d) on the jail-host, after two specific jails are started: - I have a good PROVIDE line in /usr/local/etc/ezjail/jailA (and jail0) - I have a corresponding REQUIRE line in /usr/local/etc/ezjail/jailB (and jailA for jail0) - rc.d/ezjail is called before my script (it hardlinks the mysql socket into jailB) - the jails are started in parallel -> rc.d/ezjail finishes before mysql is started - my link-script starts before mysql is up -> no DB connection possible from jailB (configured to use the unix domain socket) In my case it would be OK to block the start of everything if one jail starts, so the easy solution would be to introduce a jail_background_start variable (default: yes). Does someone have a better idea how to solve this? If not, any objections against the jail_background_start solution? Bye, Alexander. -- Sanity and insanity overlap a fine grey line. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137