jails Start jail dependent on another jail, how to ...?

Sorry,

may be I just do not know the propper kewords*.

I want to make sure that a special jail is starting after another jail, it depents on. What to do in jail.conf (FreeBSD 14) or elsewhere?

Thanks

* I'm not a native speaker
 
You can give an order in rc.conf
Code:
jail_list="jail1 jail2 jail3"
Jails are started in the order given by jail_list. Note that this isn't a dependency, only an order of starting (and in reverse for stopping).
 
depend Specify a jail (or jails) that this jail depends on. When this jail is to be created, any jail(s) it depends on must already exist. If not, they will be created automatically, up to the completion of the last exec.poststart command, before any action will taken to create this jail. When jails are removed the opposite is true: this jail will be removed, up to the last exec.poststop command, before any jail(s) it depends on are stopped.

See details: jail(8)
 
I use 'depend' for jails for a long time. It works fine.

My jail.conf example:
Code:
db64 {
        host.hostname = "db64.example.com";
        path = "/home/jails/db64";
        ip4.addr += "192.168.46.2/32";
        allow.raw_sockets = 0;
        mount.fstab = "/etc/fstab.db64";
        exec.consolelog = "/var/log/jail_db64_console.log";
}

www64 {
        host.hostname = "www.example.com";
        path = "/home/jails/www64";
        ip4.addr += "192.168.46.4/32";
        allow.raw_sockets = 0;
        mount.fstab = "/etc/fstab.www64";
        exec.consolelog = "/var/log/jail_www64_console.log";
#       depend db,db64;
        depend db64;
}
 
Back
Top