From 4813f7d3b0247dede692306621a1763b426c3b6c Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Thu, 13 Mar 2025 00:03:30 -0600 Subject: [PATCH] rc: Add comments --- usr/local/etc/rc.d/bastille | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/usr/local/etc/rc.d/bastille b/usr/local/etc/rc.d/bastille index 4d9f82b0..c19aebf8 100755 --- a/usr/local/etc/rc.d/bastille +++ b/usr/local/etc/rc.d/bastille @@ -9,18 +9,12 @@ # Add the following to /etc/rc.conf[.local] to enable this service # # bastille_enable (bool): Set to "NO" by default. -# Set it to "YES" to enable bastille. +# Set it to "YES" to enable bastille. # bastille_conf (bool): Set to "/usr/local/etc/bastille/bastille.conf" by default. -# Path to bastile.conf file. Used if bastille_rcorder="YES". -# bastille_list (string): Set to "ALL" by default. -# Space separated list of jails to start or "ALL" to start all -# jails. -# bastille_rcorder (bool): Set to "NO" by default. -# Set it to "YES" to start all jails in order, defined by -# rcorder(8). It starts all jails, except jails with "KEYWORD: -# nostart" in jail.conf. Value of bastille_list is ignored in this -# case, requires correct path to bastile.conf in bastille_conf -# var. +# Path to bastile.conf file. +# bastille_startup_delay (bool): Set to 0 by default. +# Set to a numerical value. +# This is the delay between startup of each jail. # . /etc/rc.subr @@ -40,6 +34,7 @@ restart_cmd="bastille_stop && bastille_start" bastille_start() { local _jailsdir=$(. $bastille_conf; echo $bastille_jailsdir) + # Sort jails by priority value local _priority_list=$(grep -Eo "^priority=\"[0-9]+\"$" ${_jailsdir}/*/boot.conf | sort -t '"' -k2 -n | awk -F'/' '{print $(NF-1)}') for _jail in ${_priority_list}; do @@ -63,6 +58,7 @@ bastille_start() bastille_stop() { local _jailsdir=$(. $bastille_conf; echo $bastille_jailsdir) + # Sort jails by priority value, in reverse order local _priority_list_rev=$(grep -Eo "^priority=\"[0-9]+\"$" ${_jailsdir}/*/boot.conf | sort -t '"' -k2 -nr | awk -F'/' '{print $(NF-1)}') for _jail in ${_priority_list_rev}; do