From da0f1f5085871f914a0a139f6e82345c9ce0e694 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 6 Mar 2018 12:55:31 +0000 Subject: [PATCH] Document jail.conf Jail configuration jail.conf is the preferred method of configuring jails in all supported FreeBSD versions. Older rc.conf(5) configuration produces a warning. Update the handbook example to match based on the submission in the PR, with a few modifications. PR: 187142 Submitted by: Jack-Benny Persson Reviewed by: bcr, eadler Approved by: bcr, eadler Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14524 --- .../books/handbook/jails/chapter.xml | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/jails/chapter.xml b/en_US.ISO8859-1/books/handbook/jails/chapter.xml index e18e2eca0d..2118264e9f 100644 --- a/en_US.ISO8859-1/books/handbook/jails/chapter.xml +++ b/en_US.ISO8859-1/books/handbook/jails/chapter.xml @@ -313,46 +313,41 @@ - A list of the jails which are enabled to start at boot - time should be added to the &man.rc.conf.5; file: + Configure jail parameters in + jail.conf: + www { + host.hostname = www.example.org; # Hostname + ip4.addr = 192.168.0.10; # IP address of the jail + path ="/usr/jail/www"; # Path to the jail + devfs_ruleset = "www_ruleset"; # devfs ruleset + mount.devfs; # Mount devfs inside the jail + exec.start = "/bin/sh /etc/rc"; # Start command + exec.stop = "/bin/sh /etc/rc.shutdown"; # Stop command +} - jail_enable="YES" # Set to NO to disable starting of any jails -jail_list="www" # Space separated list of names of jails + Configure jails to start at boot time in + rc.conf: - - Jail names in jail_list should - contain alphanumeric characters only. - - - - - For each jail listed in jail_list, a - group of &man.rc.conf.5; settings, which describe the - particular jail, should be added: - - jail_www_rootdir="/usr/jail/www" # jail's root directory -jail_www_hostname="www.example.org" # jail's hostname -jail_www_ip="192.168.0.10" # jail's IP address -jail_www_devfs_enable="YES" # mount devfs in the jail + jail_enable="YES" # Set to NO to disable starting of any jails The default startup of jails configured in - &man.rc.conf.5;, will run the /etc/rc + &man.jail.conf.5;, will run the /etc/rc script of the jail, which assumes the jail is a complete virtual system. For service jails, the default startup command of the jail should be changed, by setting the - jail_jailname_exec_start + exec.start option appropriately. For a full list of available options, please see the - &man.rc.conf.5; manual page. + &man.jail.conf.5; manual page. &man.service.8; can be used to start or stop a jail by hand, if an entry for it exists in - rc.conf: + jail.conf: &prompt.root; service jail start www &prompt.root; service jail stop www