mt.stop_jail: if jail isn't running, don't attempt to stop it
mt.store_config(), new function.
dhcp,dovecot,haraka,haproxy: PF port mappings moved to jails config
Previously, PF rules for port 80 & 443 were in /etc/pf.conf and pointed to haproxy. After this PR, those same PF redirect rules are located at $data/haproxy/etc/pf.conf.d/rdr.conf. Same goes for MUA, MSA, and MTA ports which moved to $data/dovecot/etc/pf.conf.d/rdr.conf and similarly haraka and dhcp.
Motivations
encapsulation: keep all the jail needs contained within its jail.conf and data partition.
flexibility: as an example, one could replace haproxy with nginx, haraka with postfix/opensmtpd/other, etc.
upon boot, some PF rules may not be ready due to dependencies.
store_config: when writing out configs, write them always as $filePath.dist, and then if $filePath doesn't exist, install it. The provides a reference for comparing after upgrades.
Changes proposed in this pull request:
Previously, PF rules for port 80 & 443 were in /etc/pf.conf and pointed to haproxy. After this PR, those same PF redirect rules are located at
$data/haproxy/etc/pf.conf.d/rdr.conf
. Same goes for MUA, MSA, and MTA ports which moved to$data/dovecot/etc/pf.conf.d/rdr.conf
and similarly haraka and dhcp.Motivations
Checklist: