How to define the order of starting jails?

Michael B. Eichorn ike at michaeleichorn.com
Sun Dec 20 19:25:22 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5729 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20151220/d8c7ab15/attachment.bin>


More information about the freebsd-questions mailing list