Solved How to stop jails in specific order on host reboot

I have the following scenario in mind: a host has 3 jails: 2 jails are running applications and the third jail is running the dabase service used by the two applications.

Say, this setup is running in the cloud in a virtualized host. There are times when the cloud provider will reboot the physical host hosting multiple VMs for me and their other customers and issue a reboot/kill signal to my FreeBSD host.

How can I ensure that the FreeBSD host begins by shutting down the application jails before shutting down the database jail?

The reason for this concern is, applications store some data in-memory to reduce write load to the DB. The applications have logic to gracefully shutdown by committing data to the DB when they receive a termination signal, however if the database jail is killed first, applications will not be able to commit the changes to the DB and data will be lost.

Any pointer would be greatly appreciated.
 
Back
Top