[systemd-commits] 3 commits - man/systemd-activate.xml man/systemd-nspawn.xml src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Mon Oct 20 16:11:21 PDT 2014


 man/systemd-activate.xml |   19 +++++------
 man/systemd-nspawn.xml   |   81 +++++++++++++++++++++++------------------------
 src/shared/mkdir-label.c |    4 --
 src/shared/mkdir.c       |    4 --
 src/shared/mkdir.h       |    2 -
 5 files changed, 50 insertions(+), 60 deletions(-)

New commits:
commit 0b3b83e59b637660524e90a07f9ef691856b19bf
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Oct 21 01:11:14 2014 +0200

    man: move one more nspawn example into a proper <example> section

diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index 22f2df4..4aa97b0 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -751,13 +751,13 @@
                         <para>This runs a copy of the host system in a
                         btrfs snapshot.</para>
                 </example>
-        </refsect1>
 
-        <refsect1>
-                <title>Run a container with SELinux sandbox security contexts</title>
+                <example>
+                        <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>
+                </example>
         </refsect1>
 
         <refsect1>

commit 1db8c66f2e500272cb5582f9087b8e2a123aee10
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sun Oct 12 00:37:23 2014 +0200

    man: use <example> instead of multiple <refsect1> for examples

diff --git a/man/systemd-activate.xml b/man/systemd-activate.xml
index 717f5c0..cde4263 100644
--- a/man/systemd-activate.xml
+++ b/man/systemd-activate.xml
@@ -144,20 +144,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
   </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>
-  </refsect1>
-
-  <refsect1>
-    <title>Example 2</title>
+      <programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 -a cat</programlisting>
+    </example>
 
-    <programlisting>$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
+    <example>
+      <title>Run a socket activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
 
-    <para>This runs a socket activated instance of
-    <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+      <programlisting>$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
+    </example>
   </refsect1>
 
   <refsect1>
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index 820a79b..22f2df4 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -694,69 +694,70 @@
         </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>
 
-                <para>This installs a minimal Fedora distribution into
-                the directory <filename noindex='true'>/srv/mycontainer/</filename> and
-                then boots an OS in a namespace container in
-                it.</para>
-        </refsect1>
+                        <para>This installs a minimal Fedora distribution into
+                        the directory <filename noindex='true'>/srv/mycontainer/</filename> and
+                        then boots an OS in a namespace container in
+                        it.</para>
+                </example>
 
-        <refsect1>
-                <title>Example 2</title>
+                <example>
+                        <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>
 
-                <para>This installs a minimal Debian unstable
-                distribution into the directory
-                <filename>~/debian-tree/</filename> and then spawns a
-                shell in a namespace container in it.</para>
-        </refsect1>
+                        <para>This installs a minimal Debian unstable
+                        distribution into the directory
+                        <filename>~/debian-tree/</filename> and then spawns a
+                        shell in a namespace container in it.</para>
+                </example>
 
-        <refsect1>
-                <title>Example 3</title>
+                <example>
+                        <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>
 
-                <para>This installs a mimimal Arch Linux distribution into
-                the directory <filename>~/arch-tree/</filename> and then
-                boots an OS in a namespace container in it.</para>
-        </refsect1>
+                        <para>This installs a mimimal Arch Linux distribution into
+                        the directory <filename>~/arch-tree/</filename> and then
+                        boots an OS in a namespace container in it.</para>
+                </example>
 
-        <refsect1>
-                <title>Example 4</title>
+                <example>
+                        <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 at arch.service
 # systemctl start systemd-nspawn at arch.service</programlisting>
 
-                <para>This makes the Arch Linux container part of the
-                <filename>multi-user.target</filename> on the host.
-                </para>
-        </refsect1>
+                        <para>This makes the Arch Linux container part of the
+                        <filename>multi-user.target</filename> on the host.
+                        </para>
+                </example>
 
-        <refsect1>
-                <title>Example 5</title>
+                <example>
+                        <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>
 
-                <para>This runs a copy of the host system in a
-                btrfs snapshot.</para>
+                        <para>This runs a copy of the host system in a
+                        btrfs snapshot.</para>
+                </example>
         </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
 # 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>

commit e2e07fec7b3002a19da48845a0985c7e8dc6cc84
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Oct 11 18:43:12 2014 +0200

    shared: remove unused functions
    
    - mkdir_p_prefix: It has never been used
    - mkdir_parents_prefix_label: Unused since 1434ae6fd49f8377b0ddbd4c675736e0d3226ea6

diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index 4ee6251..43ea2c2 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -44,10 +44,6 @@ int mkdir_parents_label(const char *path, mode_t mode) {
         return mkdir_parents_internal(NULL, path, mode, label_mkdir);
 }
 
-int mkdir_parents_prefix_label(const char *prefix, const char *path, mode_t mode) {
-        return mkdir_parents_internal(prefix, path, mode, label_mkdir);
-}
-
 int mkdir_p_label(const char *path, mode_t mode) {
         return mkdir_p_internal(NULL, path, mode, label_mkdir);
 }
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
index f941efb..fabd9e2 100644
--- a/src/shared/mkdir.c
+++ b/src/shared/mkdir.c
@@ -144,7 +144,3 @@ int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkdir_fu
 int mkdir_p(const char *path, mode_t mode) {
         return mkdir_p_internal(NULL, path, mode, mkdir);
 }
-
-int mkdir_p_prefix(const char *prefix, const char *path, mode_t mode) {
-        return mkdir_p_internal(prefix, path, mode, mkdir);
-}
diff --git a/src/shared/mkdir.h b/src/shared/mkdir.h
index dd5b41e..ca38d21 100644
--- a/src/shared/mkdir.h
+++ b/src/shared/mkdir.h
@@ -28,14 +28,12 @@
 int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
 int mkdir_parents(const char *path, mode_t mode);
 int mkdir_p(const char *path, mode_t mode);
-int mkdir_p_prefix(const char *prefix, const char *path, mode_t mode);
 
 /* selinux versions */
 int mkdir_label(const char *path, mode_t mode);
 int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
 int mkdir_parents_label(const char *path, mode_t mode);
 int mkdir_p_label(const char *path, mode_t mode);
-int mkdir_parents_prefix_label(const char *prefix, const char *path, mode_t mode);
 
 /* internally used */
 typedef int (*mkdir_func_t)(const char *pathname, mode_t mode);



More information about the systemd-commits mailing list