Priorities & Boot Flag
AppJail can start jails at system startup using the appjail RC script which is just a wrapper for appjail-startup(1). But this command only starts jails that have the boot flag set to on and the order can be specified using priorities.
Tip
It is not necessary to set the startup flag explicitly, as it is already set by default.
Since these features are very useful when used in conjunction with Dependent Jails we will use the jail used in that section.
appjail jail boot on nginx
We can use appjail-jail(1) list to see if the boot flag is enabled for this jail.
# appjail jail list -j nginx boot name
BOOT NAME
1 nginx
appjail-quick(1) can create a jail with the boot flag.
appjail quick myjail boot overwrite
Jails have the same priority at the time of their creation (unless you use the priority option in appjail-quick(1)), so appjail-startup(1) will start the jails in the order they appear. If we want to start a jail before the others we have to change the priority using appjail-jail(1) priority.
appjail jail priority -p 10 myjail
The nginx jail will be started first because 0 is high priority.
Let's see the current priorities of our jails:
# appjail jail list boot priority name
BOOT PRIORITY NAME
0 0 mariadb
1 10 myjail
1 0 nginx
0 0 php-fpm
0 0 vjail
appjail-startup(1) will stop the previous jails in reverse order.
Notes
- By default, when a jail is created using
appjail-quick(1)the boot flag is enabled by that jail. See AppJail configuration file for more details. - If
USE_PARALLELis enabled, AppJail starts the jails in parallel with the same priority in that order.