[systemd-commits] 3 commits - Makefile-man.am man/nss-myhostname.xml man/nss-mymachines.xml man/systemd-machined.service.xml

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jan 7 08:42:21 PST 2015


 Makefile-man.am                  |   13 +++-
 man/nss-myhostname.xml           |  102 ++++++++++++++++++++++------------
 man/nss-mymachines.xml           |  116 +++++++++++++++++++++++++++++++++++++++
 man/systemd-machined.service.xml |   13 +++-
 4 files changed, 203 insertions(+), 41 deletions(-)

New commits:
commit dbda6dce3d250cee3a9d2bd1591ec1746a43585f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 7 17:40:10 2015 +0100

    man: document nss-mymachines

diff --git a/Makefile-man.am b/Makefile-man.am
index f212a0f..b2869c4 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -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 \
diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml
index 0f68c4d..c7a2cd9 100644
--- a/man/nss-myhostname.xml
+++ b/man/nss-myhostname.xml
@@ -67,11 +67,12 @@
 
                 <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
@@ -125,7 +126,7 @@
 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
index 0000000..9467391
--- /dev/null
+++ b/man/nss-mymachines.xml
@@ -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 at 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>
diff --git a/man/systemd-machined.service.xml b/man/systemd-machined.service.xml
index 352b4a0..475b53a 100644
--- a/man/systemd-machined.service.xml
+++ b/man/systemd-machined.service.xml
@@ -63,8 +63,13 @@
 
                 <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>
 

commit 49aa61a550b3baadb1fb50e586d8fbe8b642025f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 7 17:19:46 2015 +0100

    man: add an alias to libnss_myhostname.so2 for nss-myhostname
    
    The module appears under the name "libnss_myhostname.so.2" in the file
    system, hence let's link it up under that name.

diff --git a/Makefile-man.am b/Makefile-man.am
index 8dc8feb..f212a0f 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -1337,8 +1337,10 @@ if HAVE_MYHOSTNAME
 MANPAGES += \
 	man/nss-myhostname.8
 MANPAGES_ALIAS += \
-	#
-
+	man/libnss_myhostname.so.2.8
+man/libnss_myhostname.so.2.8: man/nss-myhostname.8
+man/libnss_myhostname.so.2.html: man/nss-myhostname.html
+	$(html-alias)
 
 endif
 
diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml
index 999d1af..0f68c4d 100644
--- a/man/nss-myhostname.xml
+++ b/man/nss-myhostname.xml
@@ -45,6 +45,7 @@
 
         <refnamediv>
                 <refname>nss-myhostname</refname>
+                <refname>libnss_myhostname.so.2</refname>
                 <refpurpose>Provide hostname resolution for the locally
                 configured system hostname.</refpurpose>
         </refnamediv>

commit b311d32ff4fac5335aa8eea479bda49131ecae75
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 7 17:14:04 2015 +0100

    man: rework nss-myhostname man page
    
    Remove a number of incorrect links, and explain that "localhost" and
    "gateway" are now resolved by it, too.

diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml
index ba9297e..999d1af 100644
--- a/man/nss-myhostname.xml
+++ b/man/nss-myhostname.xml
@@ -50,49 +50,81 @@
         </refnamediv>
 
         <refsynopsisdiv>
-                <para><filename>nss-myhostname.la</filename></para>
+                <para><filename>libnss_myhostname.so.2</filename></para>
         </refsynopsisdiv>
 
         <refsect1>
                 <title>Description</title>
 
-                <para><command>nss-myhostname</command> is a plugin for the GNU Name Service Switch
-                (NSS) functionality of the GNU C Library (<command>glibc</command>)
-                providing hostname resolution for the locally configured system
-                hostname as returned by
-                <citerefentry><refentrytitle>gethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
-                Various software relies on an always-resolvable local hostname. When
-                using dynamic hostnames, this is usually achieved by patching
-                <filename>/etc/hosts</filename> at the same time as changing the host
-                name. This however is not ideal since it requires a writable
-                <filename>/etc</filename> file system and is fragile because the file
-                might be edited by the administrator at the same time. <command>nss-myhostname</command>
-                simply returns 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) for
-                whatever system hostname is configured locally. Patching
-                <filename>/etc/hosts</filename> is thus no longer necessary.</para>
-
-                <para>To activate the NSS modules, <option>myhostname</option>
-                has to be added to the line starting with "<varname>hosts:</varname>" in
-                <filename>/etc/nsswitch.conf</filename></para>
-
-                <para>It is recommended to put <option>myhostname</option>
-                last in 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>
+                <para><command>nss-myhostname</command> is a plugin
+                for the GNU Name Service Switch (NSS) functionality of
+                the GNU C Library (<command>glibc</command>) primarily
+                providing hostname resolution for the locally
+                configured system hostname as returned by
+                <citerefentry><refentrytitle>gethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>. The
+                precise hostnames resolved by this module are:</para>
+
+                <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>
+
+                        <listitem><para>The hostname
+                        <literal>localhost</literal> is resolved to
+                        the IP addresses 127.0.0.1 and
+                        ::1.</para></listitem>
+
+                        <listitem><para>The hostname
+                        <literal>gateway</literal> is resolved to all
+                        current default routing gateway addresses,
+                        ordered by their metric. This assigns a stable
+                        hostname to the current gateway, useful for
+                        referencing it independently of the current
+                        network configuration state.</para></listitem>
+
+                </itemizedlist>
+
+                <para>Various software relies on an always-resolvable
+                local hostname. When using dynamic hostnames, this is
+                traditionally achieved by patching
+                <filename>/etc/hosts</filename> at the same time as
+                changing the hostname. This is problematic since it
+                requires a writable <filename>/etc</filename> file
+                system and is fragile because the file might be edited
+                by the administrator at the same time. With
+                <command>nss-myhostname</command> enabled changing
+                <filename>/etc/hosts</filename> is unncessary, and on
+                many systems the file becomes entirely optional.</para>
+
+                <para>To activate the NSS modules,
+                <literal>myhostname</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>myhostname</literal> last in 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>
 
-<programlisting># /etc/nsswitch.conf
+                <para>Here's an example
+                <filename>/etc/nsswitch.conf</filename> file, that
+                enables <command>myhostname</command>
+                correctly:</para>
 
-passwd:         compat
+<programlisting>passwd:         compat
 group:          compat
 shadow:         compat
 
-hosts:          files dns <varname>myhostname</varname>
+hosts:          files dns <command>myhostname</command>
 networks:       files
 
 protocols:      db files
@@ -120,13 +152,8 @@ netgroup:       nis</programlisting>
                 <title>See Also</title>
                 <para>
                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-                        <citerefentry project='man-pages'><refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-                        <citerefentry project='man-pages'><refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-                        <citerefentry project='man-pages'><refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-                        <citerefentry project='die-net'><refentrytitle>pam_loginuid</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>
 



More information about the systemd-commits mailing list