From owner-freebsd-questions@freebsd.org Sun Dec 20 20:41:51 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9736BA4E292; Sun, 20 Dec 2015 20:41:51 +0000 (UTC) (envelope-from dweimer@dweimer.net) Received: from webmail.dweimer.net (24-240-198-187.static.stls.mo.charter.com [24.240.198.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509B518DB; Sun, 20 Dec 2015 20:41:50 +0000 (UTC) (envelope-from dweimer@dweimer.net) Received: from webmail.dweimer.local (localhost [192.168.5.2]) by webmail.dweimer.net (8.15.2/8.15.2) with ESMTPS id tBKKfhmW056452 (version=TLSv1.2 cipher=DHE-RSA-CHACHA20-POLY1305 bits=256 verify=NO); Sun, 20 Dec 2015 14:41:43 -0600 (CST) (envelope-from dweimer@dweimer.net) Received: (from www@localhost) by webmail.dweimer.local (8.15.2/8.15.2/Submit) id tBKKfgh5056451; Sun, 20 Dec 2015 14:41:42 -0600 (CST) (envelope-from dweimer@dweimer.net) X-Authentication-Warning: webmail.dweimer.local: www set sender to dweimer@dweimer.net using -f To: "Michael B. Eichorn" Subject: Re: How to define the order of starting jails? X-PHP-Script: www.dweimer.net/webmail/index.php for 192.168.5.1, 192.168.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 20 Dec 2015 14:41:41 -0600 From: dweimer Cc: Michael Grimm , freebsd-jail@freebsd.org, freebsd-questions , owner-freebsd-questions@freebsd.org Organization: dweimer.net Reply-To: dweimer@dweimer.net Mail-Reply-To: dweimer@dweimer.net In-Reply-To: <1450639510.27618.8.camel@michaeleichorn.com> References: <5D6BA0FE-60E1-4C6B-906B-BB62A1AB9BE8@odo.in-berlin.de> <1450639510.27618.8.camel@michaeleichorn.com> Message-ID: X-Sender: dweimer@dweimer.net User-Agent: Roundcube Webmail/1.1.3 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 20:41:51 -0000 On 2015-12-20 1:25 pm, Michael B. Eichorn wrote: > On Sun, 2015-12-20 at 17:50 +0100, Michael Grimm wrote: >> Hi — >> >> [Background: I wish to run (some of my) ezjail-made jails and VNET >> which cannot be done by ezjail, natively.] >> >> But I found a way to mix both ezjail and basic jail(8) functionality. >> It's quite easy to fire up ezjail-made jails defined in jail.conf by >> jail. And, now I can apply VNET to those jails I do wish to run their >> own network stacks. That's all working well. >> >> But I am bit stuck in finding a way to start my jails in a pre- >> defined order (e.g. first DNS, then mail, …). Well, I can achieve >> that during boot time by using jail_list="dns mail …" in rc.conf. >> But, this is respected during boot time, *only*. Whenever I do run a >> "jail -rc '*'" that shutdown and starting order becomes arbitrary. It >> doesn't follow the sequence of my jail definitions in jail.conf, >> either. I thoroughly checked the jail.conf(5) man page for a >> functionality that would allow me to define a startup/shutdown >> sequence, but I couldn't find it. >> >> Thus, I might have overlooked it, is there a way to achieve my goal >> using jail and jail.conf? >> Or something else? >> >> Thanks and regards, >> Michael > > jail(8)'s '*' operates on everything without concern for rc.conf, as > such jail_list is not respected. Perhaps try something tied to the rc.d > system. Does `service jail restart` do what you are looking for? > > Otherwise I would just go with simple restart script such as: > #!/bin/sh > set -e > jail -r '*' > jail -c dns > jail -c mail You can also define a jail dependency to make sure a jail starts before another one dns { ... } mail { ... depend = "dns" } -- Thanks, Dean E. Weimer http://www.dweimer.net/