From 16eb4da97e1bfe7f9416a0622b1a06408e550423 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sat, 5 Jan 2013 18:39:09 +0100 Subject: [PATCH] nss-myhostname: integrate documentation Converted from html to xml and changed the style to fit into the other manpages. --- Makefile.am | 5 + man/nss-myhostname.xml | 139 +++++++++++++++++++++ src/nss-myhostname/doc/.gitignore | 2 - src/nss-myhostname/doc/Makefile.am | 38 ------ src/nss-myhostname/doc/README.html.in | 166 -------------------------- src/nss-myhostname/doc/style.css | 25 ---- 6 files changed, 144 insertions(+), 231 deletions(-) create mode 100644 man/nss-myhostname.xml delete mode 100644 src/nss-myhostname/doc/.gitignore delete mode 100644 src/nss-myhostname/doc/Makefile.am delete mode 100644 src/nss-myhostname/doc/README.html.in delete mode 100644 src/nss-myhostname/doc/style.css diff --git a/Makefile.am b/Makefile.am index 91bc49dc5..7048cb511 100644 --- a/Makefile.am +++ b/Makefile.am @@ -587,6 +587,11 @@ man/systemd-journal-gatewayd.socket.8: man/systemd-journal-gatewayd.service.8 man/systemd-journal-gatewayd.8: man/systemd-journal-gatewayd.service.8 endif +if HAVE_MYHOSTNAME +MANPAGES += \ + man/nss-myhostname.8 +endif + man/reboot.8: man/halt.8 man/poweroff.8: man/halt.8 man/init.1: man/systemd.1 diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml new file mode 100644 index 000000000..bd3f63569 --- /dev/null +++ b/man/nss-myhostname.xml @@ -0,0 +1,139 @@ + + + + + + + + + nss-myhostname + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + nss-myhostname + 8 + + + + nss-myhostname + Provide host name resolution for the locally + configured system hostname. + + + + + nss-myhostname.la + + + + + Description + + nss-myhostname is a plugin for the GNU Name Service Switch + (NSS) functionality of the GNU C Library (glibc) + providing host name resolution for the locally configured system + hostname as returned by + gethostname2. + Various software relies on an always resolvable local host name. When + using dynamic hostnames this is usually achieved by patching + /etc/hosts at the same time as changing the host + name. This however is not ideal since it requires a writable + /etc file system and is fragile because the file + might be edited by the administrator at the same time. nss-myhostname + simply returns all locally configure public IP addresses, or -- if none + are configured -- the IPv4 address 127.0.0.2 (wich is on the local + loopback) and the IPv6 address ::1 (which is the local host) for + whatever system hostname is configured locally. Patching + /etc/hosts is thus no longer necessary. + + To activate the NSS modules, + has to be added to the line starting with "hosts:" in + /etc/nsswitch.conf + + It is recommended to put + last in the nsswitch.conf line to make + sure that this mapping is only used as fallback, and any DNS + or /etc/hosts based mapping takes precedence. + + + + Example + + +# /etc/nsswitch.conf + +passwd: compat +group: compat +shadow: compat + +hosts: files dns myhostname +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: nis + + + To test, use glibc's getent tool: + + +$ getent ahosts `hostname` +::1 STREAM omega +::1 DGRAM +::1 RAW +127.0.0.2 STREAM +127.0.0.2 DGRAM +127.0.0.2 RAW + + + In this case the local host name is omega. + + + + + See Also + + systemd1, + systemd-logind.service8, + logind.conf5, + loginctl1, + pam.conf5, + pam.d5, + pam8, + pam_loginuid8 + + + + diff --git a/src/nss-myhostname/doc/.gitignore b/src/nss-myhostname/doc/.gitignore deleted file mode 100644 index bc63974b0..000000000 --- a/src/nss-myhostname/doc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -README -README.html diff --git a/src/nss-myhostname/doc/Makefile.am b/src/nss-myhostname/doc/Makefile.am deleted file mode 100644 index 4f773ac2c..000000000 --- a/src/nss-myhostname/doc/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# This file is part of nss-myhostname. -# -# Copyright 2008 Lennart Poettering -# -# nss-myhostname 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. -# -# nss-myhostname 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 nss-myhostname. If not, If not, see -# . - -dist_html_DATA = README.html style.css -EXTRA_DIST = README.html.in - -MAINTAINERCLEANFILES = README.html -CLEANFILES = - -if USE_LYNX -dist_doc_DATA = README -MAINTAINERCLEANFILES += README - -README: README.html - lynx --dump $^ | sed 's,file://localhost/.*/doc/README.html,README,' > $@ - -CLEANFILES += README -endif - -tidy: README.html - tidy -qe < README.html ; true - -.PHONY: tidy diff --git a/src/nss-myhostname/doc/README.html.in b/src/nss-myhostname/doc/README.html.in deleted file mode 100644 index f78618298..000000000 --- a/src/nss-myhostname/doc/README.html.in +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -nss-myhostname @PACKAGE_VERSION@ - - - - -

nss-myhostname @PACKAGE_VERSION@

- -

Copyright 2005-2011 Lennart Poettering <@PACKAGE_BUGREPORT@>

- - - -

License

- -

This program 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.

- -

This program 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.

- -

News

- -
Mon May 9 2011:
- -

Version -0.3 released. Changes include: Always return locally configured IP -addresses first, use 127.0.0.2/::1 only as fallback if no addresses -are configured.

- -
Mon Oct 27 2008:
- -

Version 0.2 -released. Changes include: Update for IPv6 and newest glibc NSS interfaces

- -
Sat Nov 19 2005:
- -

Version 0.1 -released. Initial release.

- -

Overview

- -

nss-myhostname is a plugin for the GNU Name Service Switch -(NSS) functionality of the GNU C Library (glibc) providing -host name resolution for the locally configured system hostname as -returned by gethostname(2). Various software relies on an -always resolvable local host name. When using dynamic hostnames this -is usually achieved by patching /etc/hosts at the same time -as changing the host name. This however is not ideal since it requires -a writable /etc file system and is fragile because the file -might be edited by the administrator at the same -time. nss-myhostname simply returns all locally configure -public IP addresses, or -- if none are configured -- the IPv4 -address 127.0.0.2 (wich is on the local loopback) and the -IPv6 address ::1 (which is the local host) for whatever -system hostname is configured locally. Patching /etc/hosts -is thus no longer necessary.

- -

Current Status

- -

It works!

- -

Documentation

- -

After compiling and installing nss-myhostname you'll find a -new NSS modules in /lib:

- - -

To activate the NSS modules you have to edit -/etc/nsswitch.conf and add myhostname to the -line starting with "hosts:". On Debian this looks like -this:

- -
# /etc/nsswitch.conf
-
-passwd:         compat
-group:          compat
-shadow:         compat
-
-hosts:          files dns myhostname
-networks:       files
-
-protocols:      db files
-services:       db files
-ethers:         db files
-rpc:            db files
-
-netgroup:       nis
- -

That's it. You should now always be able to resolve your local -system hostname. For a quick check -use glibc's getent tool: - -

$ getent ahosts `hostname`
-::1             STREAM omega
-::1             DGRAM
-::1             RAW
-127.0.0.2       STREAM
-127.0.0.2       DGRAM
-127.0.0.2       RAW
-
- -

In this case the local host name is omega.

- -

It is recommended to put myhostname last in -the nsswitch.conf line to make sure that this mapping is only -used as fallback, and any DNS or /etc/hosts based mapping takes -precedence.

- -

Requirements

- -

nss-myhostname uses NSS interfaces that are specific to modern glibc's.

- -

nss-myhostname was developed and tested on Fedora 15 from -May 2011, it should work on most other Linux distributions since it -uses GNU autoconf and GNU libtool for source code configuration and -shared library management.

- -

Installation

- -

As this package is made with the GNU autotools you should run -./configure inside the distribution directory for configuring -the source tree. After that you should run make for -compilation and make install (as root) for installation of -nss-myhostname.

- -

Acknowledgements

- -

None so far.

- -

Download

- -

The newest release is always available from @PACKAGE_URL@

- -

The current release is @PACKAGE_VERSION@

- -

Get nss-myhostname's development sources from the GIT repository (gitweb):

- -
git clone git://git.0pointer.de/nss-myhostname
- -
-
Lennart Poettering <@PACKAGE_BUGREPORT@>, May 2011
- - - diff --git a/src/nss-myhostname/doc/style.css b/src/nss-myhostname/doc/style.css deleted file mode 100644 index 5cc21fd51..000000000 --- a/src/nss-myhostname/doc/style.css +++ /dev/null @@ -1,25 +0,0 @@ -/*** - This file is part of nss-myhostname. - - Copyright 2008 Lennart Poettering - - nss-myhostname 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. - - nss-myhostname 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 nss-myhostname. If not, If not, see - . -***/ - -body { color: black; background-color: white; } -a:link, a:visited { color: #900000; } -div.news-date { font-size: 80%; font-style: italic; } -pre { background-color: #f0f0f0; padding: 0.4cm; } -.grey { color: #8f8f8f; font-size: 80%; } -- 2.30.2