chiark / gitweb /
man: document nss-mymachines
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Jan 2015 16:40:10 +0000 (17:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Jan 2015 16:40:10 +0000 (17:40 +0100)
Makefile-man.am
man/nss-myhostname.xml
man/nss-mymachines.xml [new file with mode: 0644]
man/systemd-machined.service.xml

index f212a0f..b2869c4 100644 (file)
@@ -1171,10 +1171,16 @@ endif
 if ENABLE_MACHINED
 MANPAGES += \
        man/machinectl.1 \
+       man/nss-mymachines.8 \
        man/systemd-machined.service.8
 MANPAGES_ALIAS += \
+       man/libnss_mymachines.so.2.8 \
        man/systemd-machined.8
+man/libnss_mymachines.so.2.8: man/nss-mymachines.8
 man/systemd-machined.8: man/systemd-machined.service.8
+man/libnss_mymachines.so.2.html: man/nss-mymachines.html
+       $(html-alias)
+
 man/systemd-machined.html: man/systemd-machined.service.html
        $(html-alias)
 
@@ -1637,6 +1643,7 @@ EXTRA_DIST += \
        man/machinectl.xml \
        man/modules-load.d.xml \
        man/nss-myhostname.xml \
+       man/nss-mymachines.xml \
        man/os-release.xml \
        man/pam_systemd.xml \
        man/resolved.conf.xml \
index 0f68c4d..c7a2cd9 100644 (file)
 
                 <itemizedlist>
                         <listitem><para>The local, configured hostname
-                        is resolved to all locally configured public
-                        IP addresses, or -- if none are configured --
-                        the IPv4 address 127.0.0.2 (which is on the
-                        local loopback) and the IPv6 address ::1
-                        (which is the local host).</para></listitem>
+                        is resolved to all locally configured IP
+                        addresses ordered by their scope, or -- if
+                        none are configured -- the IPv4 address
+                        127.0.0.2 (which is on the local loopback) and
+                        the IPv6 address ::1 (which is the local
+                        host).</para></listitem>
 
                         <listitem><para>The hostname
                         <literal>localhost</literal> is resolved to
 group:          compat
 shadow:         compat
 
-hosts:          files dns <command>myhostname</command>
+hosts:          files dns mymachines <command>myhostname</command>
 networks:       files
 
 protocols:      db files
@@ -153,6 +154,7 @@ netgroup:       nis</programlisting>
                 <title>See Also</title>
                 <para>
                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                         <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                         <citerefentry project='man-pages'><refentrytitle>getent</refentrytitle><manvolnum>1</manvolnum></citerefentry>
                 </para>
diff --git a/man/nss-mymachines.xml b/man/nss-mymachines.xml
new file mode 100644 (file)
index 0000000..9467391
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+  This file is part of systemd.
+
+  Copyright 2014 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="nss-mymachines" conditional='ENABLE_MACHINED'>
+
+        <refentryinfo>
+                <title>nss-mymachines</title>
+                <productname>systemd</productname>
+
+                <authorgroup>
+                        <author>
+                                <contrib>Developer</contrib>
+                                <firstname>Lennart</firstname>
+                                <surname>Poettering</surname>
+                                <email>lennart@poettering.net</email>
+                        </author>
+                </authorgroup>
+        </refentryinfo>
+
+        <refmeta>
+                <refentrytitle>nss-mymachines</refentrytitle>
+                <manvolnum>8</manvolnum>
+        </refmeta>
+
+        <refnamediv>
+                <refname>nss-mymachines</refname>
+                <refname>libnss_mymachines.so.2</refname>
+                <refpurpose>Provide hostname resolution for local
+                container instances.</refpurpose>
+        </refnamediv>
+
+        <refsynopsisdiv>
+                <para><filename>libnss_mymachines.so.2</filename></para>
+        </refsynopsisdiv>
+
+        <refsect1>
+                <title>Description</title>
+
+                <para><command>nss-mymachines</command> is a plugin
+                for the GNU Name Service Switch (NSS) functionality of
+                the GNU C Library (<command>glibc</command>) providing
+                hostname resolution for containers running locally,
+                that are registered with
+                <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
+                container names are resolved to IP addresses of the
+                specific container, ordered by their scope.</para>
+
+                <para>To activate the NSS modules,
+                <literal>mymachines</literal> has to be added to the
+                line starting with <literal>hosts:</literal> in
+                <filename>/etc/nsswitch.conf</filename>.</para>
+
+                <para>It is recommended to place
+                <literal>mymachines</literal> near the end of the
+                <filename>nsswitch.conf</filename> line to make sure
+                that this mapping is only used as fallback, and any
+                DNS or <filename>/etc/hosts</filename> based mapping
+                takes precedence.</para>
+        </refsect1>
+
+        <refsect1>
+                <title>Example</title>
+
+                <para>Here's an example
+                <filename>/etc/nsswitch.conf</filename> file, that
+                enables <command>mymachines</command>
+                correctly:</para>
+
+<programlisting>passwd:         compat
+group:          compat
+shadow:         compat
+
+hosts:          files dns <command>mymachines</command> myhostname
+networks:       files
+
+protocols:      db files
+services:       db files
+ethers:         db files
+rpc:            db files
+
+netgroup:       nis</programlisting>
+
+        </refsect1>
+
+        <refsect1>
+                <title>See Also</title>
+                <para>
+                        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>nss-myhostname</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                        <citerefentry project='man-pages'><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+                        <citerefentry project='man-pages'><refentrytitle>getent</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+                </para>
+        </refsect1>
+
+</refentry>
index 352b4a0..475b53a 100644 (file)
 
                 <para>See
                 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-                for some examples on how to start a container the systemd
-                way.</para>
+                for some examples on how to run containers with OS tools.</para>
+
+                <para>Use
+                <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+                to make the names of local containers known to
+                <command>systemd-machined</command> locally resolvable
+                as host names.</para>
 
                 <para>See the <ulink
                 url="http://www.freedesktop.org/wiki/Software/systemd/machined">
@@ -78,7 +83,9 @@
                 <para>
                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
+                        <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>nss-mymachines</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
                 </para>
         </refsect1>