{{ jail.name }} { vnet; persist; exec.clean; allow.raw_sockets; mount.devfs; {% for opt in jail.options %} {{ opt }}; {% endfor %} devfs_ruleset = {{ jail.devfs_ruleset }}; host.hostname = "${name}"; path = "/usr/local/jails/containers/${name}"; exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; # Networking exec.prestart += "jail_net prestart ${name} {{ jail.num }} {{ jail.ip }}"; exec.poststart += "jail_net poststart ${name} {{ jail.num }} {{ jail.ip }}"; exec.prestop += "jail_net prestop ${name} {{ jail.num }} {{ jail.ip }}"; exec.poststop += "jail_net poststop ${name} {{ jail.num }} {{ jail.ip }}"; # Custom hooks {% for cmd in jail.exec_prestart %} exec.prestart += "{{ cmd }}"; {% endfor %} {% for cmd in jail.exec_start %} exec.start += "{{ cmd }}"; {% endfor %} {% for cmd in jail.exec_poststart %} exec.poststart += "{{ cmd }}"; {% endfor %} {% for cmd in jail.exec_prestop %} exec.prestop += "{{ cmd }}"; {% endfor %} {% for cmd in jail.exec_stop %} exec.stop += "{{ cmd }}"; {% endfor %} {% for cmd in jail.exec_poststop %} exec.poststop += "{{ cmd }}"; {% endfor %} # nullfs mounts {% for mount in jail.nullfs %} mount += "{{ mount.src }} ${path}{{ mount.dst }} nullfs {{ mount.mode | default('rw') }} 0 0"; {% endfor %} }