The translation is temporarily closed for contributions due to maintenance, please come back later.

Source string Read only

(itstool) path: para/buildtarget
Context English State
The <varname>jail_<replaceable>name</replaceable>_rootdir</varname> variable is set to <filename>/usr/home</filename> instead of <filename>/home</filename> because the physical path of <filename>/home</filename> on a default FreeBSD installation is <filename>/usr/home</filename>. The <varname>jail_<replaceable>name</replaceable>_rootdir</varname> variable must <emphasis>not</emphasis> be set to a path which includes a symbolic link, otherwise the jails will refuse to start.
Create the required mount points for the read-only file system of each jail:
<prompt>#</prompt> <userinput>mkdir /home/j/ns /home/j/mail /home/j/www</userinput>
Install the read-write template into each jail using <package>sysutils/cpdup</package>:
<prompt>#</prompt> <userinput>mkdir /home/js</userinput>
<prompt>#</prompt> <userinput>cpdup /home/j/skel /home/js/ns</userinput>
<prompt>#</prompt> <userinput>cpdup /home/j/skel /home/js/mail</userinput>
<prompt>#</prompt> <userinput>cpdup /home/j/skel /home/js/www</userinput>
In this phase, the jails are built and prepared to run. First, mount the required file systems for each jail, and then start them:
<prompt>#</prompt> <userinput>mount -a</userinput>
<prompt>#</prompt> <userinput>service jail start</userinput>
The jails should be running now. To check if they have started correctly, use <command>jls</command>. Its output should be similar to the following:
<prompt>#</prompt> <userinput>jls</userinput>
JID IP Address Hostname Path
3 192.168.3.17 ns.example.org /home/j/ns
2 192.168.3.18 mail.example.org /home/j/mail
1 62.123.43.14 www.example.org /home/j/www
At this point, it should be possible to log onto each jail, add new users, or configure daemons. The <literal>JID</literal> column indicates the jail identification number of each running jail. Use the following command to perform administrative tasks in the jail whose <acronym>JID</acronym> is <literal>3</literal>:
<prompt>#</prompt> <userinput>jexec 3 tcsh</userinput>
Upgrading
The design of this setup provides an easy way to upgrade existing jails while minimizing their downtime. Also, it provides a way to roll back to the older version should a problem occur.
The first step is to upgrade the host system. Then, create a new temporary read-only template in <filename>/home/j/mroot2</filename>.
<prompt>#</prompt> <userinput>mkdir /home/j/mroot2</userinput>
<prompt>#</prompt> <userinput>cd /usr/src</userinput>
<prompt>#</prompt> <userinput>make installworld DESTDIR=/home/j/mroot2</userinput>
<prompt>#</prompt> <userinput>cd /home/j/mroot2</userinput>
<prompt>#</prompt> <userinput>cpdup /usr/src usr/src</userinput>
<prompt>#</prompt> <userinput>mkdir s</userinput>
installworld
The <_:buildtarget-1/> creates a few unnecessary directories, which should be removed:
<prompt>#</prompt> <userinput>chflags -R 0 var</userinput>
<prompt>#</prompt> <userinput>rm -R etc var root usr/local tmp</userinput>
Recreate the read-write symlinks for the master file system:
<prompt>#</prompt> <userinput>ln -s s/etc etc</userinput>
<prompt>#</prompt> <userinput>ln -s s/root root</userinput>
<prompt>#</prompt> <userinput>ln -s s/home home</userinput>
<prompt>#</prompt> <userinput>ln -s ../s/usr-local usr/local</userinput>
<prompt>#</prompt> <userinput>ln -s ../s/usr-X11R6 usr/X11R6</userinput>
<prompt>#</prompt> <userinput>ln -s s/tmp tmp</userinput>
<prompt>#</prompt> <userinput>ln -s s/var var</userinput>
Next, stop the jails:
<prompt>#</prompt> <userinput>service jail stop</userinput>
Unmount the original file systems as the read-write systems are attached to the read-only system (<filename>/s</filename>):
<prompt>#</prompt> <userinput>umount /home/j/ns/s</userinput>
<prompt>#</prompt> <userinput>umount /home/j/ns</userinput>
<prompt>#</prompt> <userinput>umount /home/j/mail/s</userinput>
<prompt>#</prompt> <userinput>umount /home/j/mail</userinput>
<prompt>#</prompt> <userinput>umount /home/j/www/s</userinput>
<prompt>#</prompt> <userinput>umount /home/j/www</userinput>
Move the old read-only file system and replace it with the new one. This will serve as a backup and archive of the old read-only file system should something go wrong. The naming convention used here corresponds to when a new read-only file system has been created. Move the original FreeBSD Ports Collection over to the new file system to save some space and inodes:
<prompt>#</prompt> <userinput>cd /home/j</userinput>
<prompt>#</prompt> <userinput>mv mroot mroot.20060601</userinput>
<prompt>#</prompt> <userinput>mv mroot2 mroot</userinput>
<prompt>#</prompt> <userinput>mv mroot.20060601/usr/ports mroot/usr</userinput>
At this point the new read-only template is ready, so the only remaining task is to remount the file systems and start the jails:
Use <command>jls</command> to check if the jails started correctly. Run <command>mergemaster</command> in each jail to update the configuration files.
Managing Jails with <application>ezjail</application>
Creating and managing multiple jails can quickly become tedious and error-prone. Dirk Engling's <application>ezjail</application> automates and greatly simplifies many jail tasks. A <emphasis>basejail</emphasis> is created as a template. Additional jails use <citerefentry><refentrytitle>mount_nullfs</refentrytitle><manvolnum>8</manvolnum></citerefentry> to share many of the basejail directories without using additional disk space. Each additional jail takes only a few megabytes of disk space before applications are installed. Upgrading the copy of the userland in the basejail automatically upgrades all of the other jails.
Additional benefits and features are described in detail on the <application>ezjail</application> web site, <link xlink:href="https://erdgeist.org/arts/software/ezjail/"/>.
Component Translation Difference to current string
This translation Translated FreeBSD Doc (Archived)/books_handbook
The following strings have the same context and source.
Translated FreeBSD Doc (Archived)/FreeBSD Doc (Archived)
Translated FreeBSD Doc (Archived)/books_faq
Translated FreeBSD Doc (Archived)/articles_nanobsd

Loading…

No matching activity found.

Browse all component changes

Things to check

Multiple failing checks

Following checks are failing:
Unchanged translation: Chinese (Simplified) (zh_CN), Portuguese (Brazil)
Has been translated: Turkish (tr_TR)

Reset

Source information

Source string comment
(itstool) path: para/buildtarget
Flags
read-only
Source string location
book.translate.xml:30734 book.translate.xml:30945
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 4980