man: use <example> instead of multiple <refsect1> for examples
This commit is contained in:
parent
e2e07fec7b
commit
1db8c66f2e
|
@ -144,20 +144,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Example 1</title>
|
<title>Examples</title>
|
||||||
|
|
||||||
<programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 -a cat</programlisting>
|
<example>
|
||||||
|
<title>Run an echo server on port 2000</title>
|
||||||
|
|
||||||
<para>This runs an echo server on port 2000.</para>
|
<programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 -a cat</programlisting>
|
||||||
</refsect1>
|
</example>
|
||||||
|
|
||||||
<refsect1>
|
<example>
|
||||||
<title>Example 2</title>
|
<title>Run a socket activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
|
||||||
|
|
||||||
<programlisting>$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
|
<programlisting>$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
|
||||||
|
</example>
|
||||||
<para>This runs a socket activated instance of
|
|
||||||
<citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
|
|
@ -694,69 +694,70 @@
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Example 1</title>
|
<title>Examples</title>
|
||||||
|
<example>
|
||||||
|
<title>Boot a minimal Fedora distribution in a container</title>
|
||||||
|
|
||||||
<programlisting># yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal
|
<programlisting># yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal
|
||||||
# systemd-nspawn -bD /srv/mycontainer</programlisting>
|
# systemd-nspawn -bD /srv/mycontainer</programlisting>
|
||||||
|
|
||||||
<para>This installs a minimal Fedora distribution into
|
<para>This installs a minimal Fedora distribution into
|
||||||
the directory <filename noindex='true'>/srv/mycontainer/</filename> and
|
the directory <filename noindex='true'>/srv/mycontainer/</filename> and
|
||||||
then boots an OS in a namespace container in
|
then boots an OS in a namespace container in
|
||||||
it.</para>
|
it.</para>
|
||||||
</refsect1>
|
</example>
|
||||||
|
|
||||||
<refsect1>
|
<example>
|
||||||
<title>Example 2</title>
|
<title>Spawn a shell in a container of a minimal Debian unstable distribution</title>
|
||||||
|
|
||||||
<programlisting># debootstrap --arch=amd64 unstable ~/debian-tree/
|
<programlisting># debootstrap --arch=amd64 unstable ~/debian-tree/
|
||||||
# systemd-nspawn -D ~/debian-tree/</programlisting>
|
# systemd-nspawn -D ~/debian-tree/</programlisting>
|
||||||
|
|
||||||
<para>This installs a minimal Debian unstable
|
<para>This installs a minimal Debian unstable
|
||||||
distribution into the directory
|
distribution into the directory
|
||||||
<filename>~/debian-tree/</filename> and then spawns a
|
<filename>~/debian-tree/</filename> and then spawns a
|
||||||
shell in a namespace container in it.</para>
|
shell in a namespace container in it.</para>
|
||||||
</refsect1>
|
</example>
|
||||||
|
|
||||||
<refsect1>
|
<example>
|
||||||
<title>Example 3</title>
|
<title>Boot a minimal Arch Linux distribution in a container</title>
|
||||||
|
|
||||||
<programlisting># pacstrap -c -d ~/arch-tree/ base
|
<programlisting># pacstrap -c -d ~/arch-tree/ base
|
||||||
# systemd-nspawn -bD ~/arch-tree/</programlisting>
|
# systemd-nspawn -bD ~/arch-tree/</programlisting>
|
||||||
|
|
||||||
<para>This installs a mimimal Arch Linux distribution into
|
<para>This installs a mimimal Arch Linux distribution into
|
||||||
the directory <filename>~/arch-tree/</filename> and then
|
the directory <filename>~/arch-tree/</filename> and then
|
||||||
boots an OS in a namespace container in it.</para>
|
boots an OS in a namespace container in it.</para>
|
||||||
</refsect1>
|
</example>
|
||||||
|
|
||||||
<refsect1>
|
<example>
|
||||||
<title>Example 4</title>
|
<title>Enable Arch Linux container on boot</title>
|
||||||
|
|
||||||
<programlisting># mv ~/arch-tree /var/lib/container/arch
|
<programlisting># mv ~/arch-tree /var/lib/container/arch
|
||||||
# systemctl enable systemd-nspawn@arch.service
|
# systemctl enable systemd-nspawn@arch.service
|
||||||
# systemctl start systemd-nspawn@arch.service</programlisting>
|
# systemctl start systemd-nspawn@arch.service</programlisting>
|
||||||
|
|
||||||
<para>This makes the Arch Linux container part of the
|
<para>This makes the Arch Linux container part of the
|
||||||
<filename>multi-user.target</filename> on the host.
|
<filename>multi-user.target</filename> on the host.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</example>
|
||||||
|
|
||||||
<refsect1>
|
<example>
|
||||||
<title>Example 5</title>
|
<title>Boot into a btrfs snapshot of the host system</title>
|
||||||
|
|
||||||
<programlisting># btrfs subvolume snapshot / /.tmp
|
<programlisting># btrfs subvolume snapshot / /.tmp
|
||||||
# systemd-nspawn --private-network -D /.tmp -b</programlisting>
|
# systemd-nspawn --private-network -D /.tmp -b</programlisting>
|
||||||
|
|
||||||
<para>This runs a copy of the host system in a
|
<para>This runs a copy of the host system in a
|
||||||
btrfs snapshot.</para>
|
btrfs snapshot.</para>
|
||||||
|
</example>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Example 6</title>
|
<title>Run a container with SELinux sandbox security contexts</title>
|
||||||
|
|
||||||
<programlisting># chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container
|
<programlisting># chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container
|
||||||
# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh</programlisting>
|
# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh</programlisting>
|
||||||
|
|
||||||
<para>This runs a container with SELinux sandbox security contexts.</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
|
Loading…
Reference in a new issue