summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile-man.am12
-rw-r--r--man/machinectl.xml2
-rw-r--r--man/nss-myhostname.xml32
-rw-r--r--man/nss-mymachines.xml43
-rw-r--r--man/nss-resolve.xml45
-rw-r--r--man/systemd-importd.service.xml82
-rw-r--r--src/basic/ether-addr-util.c11
-rw-r--r--src/basic/ether-addr-util.h7
-rw-r--r--src/basic/hostname-util.c5
-rw-r--r--src/journal/journal-file.c4
-rw-r--r--src/machine/machinectl.c2
-rw-r--r--src/network/networkctl.c47
-rw-r--r--units/systemd-importd.service.in1
-rw-r--r--units/systemd-resolved.service.m4.in3
14 files changed, 203 insertions, 93 deletions
diff --git a/Makefile-man.am b/Makefile-man.am
index b2af8982cd..3f03afc2ef 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -1898,6 +1898,17 @@ MANPAGES_ALIAS += \
endif
+if ENABLE_IMPORTD
+MANPAGES += \
+ man/systemd-importd.service.8
+MANPAGES_ALIAS += \
+ man/systemd-importd.8
+man/systemd-importd.8: man/systemd-importd.service.8
+man/systemd-importd.html: man/systemd-importd.service.html
+ $(html-alias)
+
+endif
+
if ENABLE_LOCALED
MANPAGES += \
man/localectl.1 \
@@ -2579,6 +2590,7 @@ EXTRA_DIST += \
man/systemd-hibernate-resume@.service.xml \
man/systemd-hostnamed.service.xml \
man/systemd-hwdb.xml \
+ man/systemd-importd.service.xml \
man/systemd-inhibit.xml \
man/systemd-initctl.service.xml \
man/systemd-journal-gatewayd.service.xml \
diff --git a/man/machinectl.xml b/man/machinectl.xml
index 8d65155d9e..967ca01470 100644
--- a/man/machinectl.xml
+++ b/man/machinectl.xml
@@ -933,7 +933,7 @@
<title>Download a Fedora image, set a root password in it, start
it as service</title>
- <programlisting># machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.raw.xz
+ <programlisting># machinectl pull-raw --verify=no https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.raw.xz
# systemd-nspawn -M Fedora-Cloud-Base-23-20151030
# passwd
# exit
diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml
index 251bdecbad..f8837745ae 100644
--- a/man/nss-myhostname.xml
+++ b/man/nss-myhostname.xml
@@ -57,12 +57,11 @@
<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>), 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>
+ <para><command>nss-myhostname</command> is a plug-in module 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
@@ -80,7 +79,6 @@
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
@@ -93,29 +91,25 @@
changing <filename>/etc/hosts</filename> is unnecessary, 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>To activate the NSS modules, add <literal>myhostname</literal> 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 that any DNS or
- <filename>/etc/hosts</filename> based mapping takes
- precedence.</para>
+ <para>It is recommended to place <literal>myhostname</literal> last in the <filename>nsswitch.conf</filename>'
+ <literal>hosts:</literal> line to make sure that this mapping is only used as fallback, and that any DNS or
+ <filename>/etc/hosts</filename> based mapping takes precedence.</para>
</refsect1>
<refsect1>
<title>Example</title>
- <para>Here is an example <filename>/etc/nsswitch.conf</filename>
- file that enables <command>myhostname</command> correctly:</para>
+ <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
+ <command>nss-myhostname</command> correctly:</para>
<programlisting>passwd: compat mymachines
group: compat mymachines
shadow: compat
-hosts: files resolve mymachines <command>myhostname</command>
+hosts: files mymachines resolve <command>myhostname</command>
networks: files
protocols: db files
diff --git a/man/nss-mymachines.xml b/man/nss-mymachines.xml
index d2bec763bb..ec047449bf 100644
--- a/man/nss-mymachines.xml
+++ b/man/nss-mymachines.xml
@@ -56,42 +56,37 @@
<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
- container names of containers running locally that are registered
- with
- <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
- The container names are resolved to the IP addresses of the
- specific container, ordered by their scope.</para>
-
- <para>The module also resolves user IDs used by containers to user
- names indicating the container name, and back.</para>
-
- <para>To activate the NSS modules, <literal>mymachines</literal>
- has to be added to the lines starting with
- <literal>hosts:</literal>, <literal>passwd:</literal> and
- <literal>group:</literal> in
+ <para><command>nss-mymachines</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of
+ the GNU C Library (<command>glibc</command>), providing hostname resolution for the names of containers running
+ locally that are registered with
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
+ container names are resolved to the IP addresses of the specific container, ordered by their scope. This
+ functionality only applies to containers using network namespacing.</para>
+
+ <para>The module also resolves user and group IDs used by containers to user and group names indicating the
+ container name, and back. This functionality only applies to containers using user namespacing.</para>
+
+ <para>To activate the NSS module, add <literal>mymachines</literal> to the lines starting with
+ <literal>hosts:</literal>, <literal>passwd:</literal> and <literal>group:</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> lines to
- make sure that its mappings are only used as fallback, and that any
- other mappings, such as DNS or <filename>/etc/hosts</filename>
- based mappings, take precedence.</para>
+ <para>It is recommended to place <literal>mymachines</literal> after the <literal>files</literal> or
+ <literal>compat</literal> entry of the <filename>/etc/nsswitch.conf</filename> lines to make sure that its mappings
+ are preferred over other resolvers such as DNS, but so that <filename>/etc/hosts</filename>,
+ <filename>/etc/passwd</filename> and <filename>/etc/group</filename> based mappings take precedence.</para>
</refsect1>
<refsect1>
<title>Example</title>
- <para>Here is an example <filename>/etc/nsswitch.conf</filename>
- file that enables <command>mymachines</command> correctly:</para>
+ <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables
+ <command>nss-mymachines</command> correctly:</para>
<programlisting>passwd: compat <command>mymachines</command>
group: compat <command>mymachines</command>
shadow: compat
-hosts: files resolve <command>mymachines</command> myhostname
+hosts: files <command>mymachines</command> resolve myhostname
networks: files
protocols: db files
diff --git a/man/nss-resolve.xml b/man/nss-resolve.xml
index 8b0928145f..d9e56453e8 100644
--- a/man/nss-resolve.xml
+++ b/man/nss-resolve.xml
@@ -56,37 +56,36 @@
<refsect1>
<title>Description</title>
- <para><command>nss-resolve</command> is a plugin module for the
- GNU Name Service Switch (NSS) functionality of the GNU C Library
- (<command>glibc</command>) enabling it to resolve host names via
- the
- <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- local network name resolution service.</para>
-
- <para>To activate the NSS module, <literal>resolve</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>resolve</literal> early
- in the <filename>nsswitch.conf</filename> line (but after the
- <literal>files</literal> entry), replacing the
- <literal>dns</literal> entry if it exists, to ensure DNS queries
- are always routed via
+ <para><command>nss-resolve</command> is a plug-in module for the GNU Name Service Switch (NSS) functionality of the
+ GNU C Library (<command>glibc</command>) enabling it to resolve host names via the
+ <citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry> local network
+ name resolution service. It replaces the <command>nss-dns</command> plug-in module that traditionally resolves
+ hostnames via DNS.</para>
+
+ <para>To activate the NSS module, add <literal>resolve</literal> to the line starting with
+ <literal>hosts:</literal> in <filename>/etc/nsswitch.conf</filename>.</para>
+
+ <para>It is recommended to place <literal>resolve</literal> early in <filename>/etc/nsswitch.conf</filename>'
+ <literal>hosts:</literal> line (but after the <literal>files</literal> or <literal>mymachines</literal> entries),
+ replacing the <literal>dns</literal> entry if it exists, to ensure DNS queries are always routed via
<citerefentry><refentrytitle>systemd-resolved</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+
+ <para>Note that <command>nss-resolve</command> will chain-load <command>nss-dns</command> if
+ <filename>systemd-resolved.service</filename> is not running, ensuring that basic DNS resolution continues to work
+ if the service is down.</para>
</refsect1>
<refsect1>
<title>Example</title>
- <para>Here is an example <filename>/etc/nsswitch.conf</filename>
- file that enables <command>resolve</command> correctly:</para>
+ <para>Here is an example <filename>/etc/nsswitch.conf</filename> file that enables <command>nss-resolve</command>
+ correctly:</para>
<programlisting>passwd: compat mymachines
group: compat mymachines
shadow: compat
-hosts: files <command>resolve</command> mymachines myhostname
+hosts: files mymachines <command>resolve</command> myhostname
networks: files
protocols: db files
@@ -96,12 +95,6 @@ rpc: db files
netgroup: nis</programlisting>
- <para>Note that <command>nss-resolve</command> will chain-load
- <command>nss-dns</command> if
- <filename>systemd-resolved.service</filename> is not running,
- ensuring that basic DNS resolution continues to work if the
- service is down.</para>
-
</refsect1>
<refsect1>
diff --git a/man/systemd-importd.service.xml b/man/systemd-importd.service.xml
new file mode 100644
index 0000000000..8fdced475c
--- /dev/null
+++ b/man/systemd-importd.service.xml
@@ -0,0 +1,82 @@
+<?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 2016 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="systemd-importd.service" conditional='ENABLE_IMPORTD'>
+
+ <refentryinfo>
+ <title>systemd-importd.service</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>systemd-importd.service</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-importd.service</refname>
+ <refname>systemd-importd</refname>
+ <refpurpose>VM and container image import and export service</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>systemd-importd.service</filename></para>
+ <para><filename>/usr/lib/systemd/systemd-importd</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><command>systemd-importd</command> is a system service that allows importing, exporting and downloading of
+ system images suitable for running as VM or containers. It is a companion service for
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and provides the implementation for
+ <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
+ <command>pull-raw</command>, <command>pull-tar</command>, <command>import-raw</command>,
+ <command>import-tar</command>, <command>export-raw</command>, and <command>export-tar</command> commands.</para>
+
+ <para>See the
+ <ulink url="http://www.freedesktop.org/wiki/Software/systemd/importd">
+ importd D-Bus API Documentation</ulink> for information about the
+ APIs <filename>systemd-importd</filename> provides.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/src/basic/ether-addr-util.c b/src/basic/ether-addr-util.c
index d2c030903b..a4d8d656da 100644
--- a/src/basic/ether-addr-util.c
+++ b/src/basic/ether-addr-util.c
@@ -43,17 +43,6 @@ char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR
return buffer;
}
-bool ether_addr_is_null(const struct ether_addr *addr) {
- assert(addr);
-
- return addr->ether_addr_octet[0] == 0 &&
- addr->ether_addr_octet[1] == 0 &&
- addr->ether_addr_octet[2] == 0 &&
- addr->ether_addr_octet[3] == 0 &&
- addr->ether_addr_octet[4] == 0 &&
- addr->ether_addr_octet[5] == 0;
-}
-
bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
assert(a);
assert(b);
diff --git a/src/basic/ether-addr-util.h b/src/basic/ether-addr-util.h
index 00c5159fe8..074363793e 100644
--- a/src/basic/ether-addr-util.h
+++ b/src/basic/ether-addr-util.h
@@ -28,5 +28,10 @@
#define ETHER_ADDR_TO_STRING_MAX (3*6)
char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]);
-bool ether_addr_is_null(const struct ether_addr *addr);
bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b);
+
+#define ETHER_ADDR_NULL ((const struct ether_addr){})
+
+static inline bool ether_addr_is_null(const struct ether_addr *addr) {
+ return ether_addr_equal(addr, &ETHER_ADDR_NULL);
+}
diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c
index a30cc86456..3cd2f2c872 100644
--- a/src/basic/hostname-util.c
+++ b/src/basic/hostname-util.c
@@ -48,8 +48,9 @@ bool hostname_is_set(void) {
char* gethostname_malloc(void) {
struct utsname u;
- /* This call tries to return something useful, either the actual hostname or it makes something up. The only
- * reason it might mail is OOM. It might even return "localhost" if that's set. */
+ /* This call tries to return something useful, either the actual hostname
+ * or it makes something up. The only reason it might fail is OOM.
+ * It might even return "localhost" if that's set. */
assert_se(uname(&u) >= 0);
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 7abdceb690..bed825cdc3 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -238,8 +238,10 @@ int journal_file_set_offline(JournalFile *f, bool wait) {
journal_file_set_offline_internal(f);
else {
r = pthread_create(&f->offline_thread, NULL, journal_file_set_offline_thread, f);
- if (r > 0)
+ if (r > 0) {
+ f->offline_state = OFFLINE_JOINED;
return -r;
+ }
}
return 0;
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 908ae1c2bb..492d35f86f 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -1763,7 +1763,7 @@ static int transfer_image_common(sd_bus *bus, sd_bus_message *m) {
r = sd_bus_call(bus, m, 0, &error, &reply);
if (r < 0) {
- log_error("Failed transfer image: %s", bus_error_message(&error, -r));
+ log_error("Failed to transfer image: %s", bus_error_message(&error, -r));
return r;
}
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index d1aec9a7dc..07ac15f478 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -901,10 +901,43 @@ static char *lldp_capabilities_to_string(uint16_t x) {
return ret;
}
+static void lldp_capabilities_legend(uint16_t x) {
+ unsigned w, i, cols = columns();
+ static const char const* table[] = {
+ "o - Other",
+ "p - Repeater",
+ "b - Bridge",
+ "w - WLAN Access Point",
+ "r - Router",
+ "t - Telephone",
+ "d - DOCSIS cable device",
+ "a - Station",
+ "c - Customer VLAN",
+ "s - Service VLAN",
+ "m - Two-port MAC Relay (TPMR)",
+ };
+
+ if (x == 0)
+ return;
+
+ printf("\nCapability Flags:\n");
+ for (w = 0, i = 0; i < ELEMENTSOF(table); i++)
+ if (x & (1U << i) || arg_all) {
+ bool newline;
+
+ newline = w + strlen(table[i]) + (w == 0 ? 0 : 2) > cols;
+ if (newline)
+ w = 0;
+ w += printf("%s%s%s", newline ? "\n" : "", w == 0 ? "" : "; ", table[i]);
+ }
+ puts("");
+}
+
static int link_lldp_status(int argc, char *argv[], void *userdata) {
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
_cleanup_free_ LinkInfo *links = NULL;
int i, r, c, m = 0;
+ uint16_t all = 0;
r = sd_netlink_open(&rtnl);
if (r < 0)
@@ -982,8 +1015,10 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
port_description = pdesc;
}
- if (sd_lldp_neighbor_get_enabled_capabilities(n, &cc) >= 0)
+ if (sd_lldp_neighbor_get_enabled_capabilities(n, &cc) >= 0) {
capabilities = lldp_capabilities_to_string(cc);
+ all |= cc;
+ }
printf("%-16s %-17s %-16s %-11s %-17s %-16s\n",
links[i].name,
@@ -997,12 +1032,10 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
}
}
- if (arg_legend)
- printf("\nCapability Flags:\n"
- "o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;\n"
- "t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;\n"
- "s - Service VLAN, m - Two-port MAC Relay (TPMR)\n\n"
- "%i neighbors listed.\n", m);
+ if (arg_legend) {
+ lldp_capabilities_legend(all);
+ printf("\n%i neighbors listed.\n", m);
+ }
return 0;
}
diff --git a/units/systemd-importd.service.in b/units/systemd-importd.service.in
index d3238cf8f5..b74ad72cdc 100644
--- a/units/systemd-importd.service.in
+++ b/units/systemd-importd.service.in
@@ -8,6 +8,7 @@
[Unit]
Description=Virtual Machine and Container Download Service
Documentation=man:systemd-importd.service(8)
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/importd
[Service]
ExecStart=@rootlibexecdir@/systemd-importd
diff --git a/units/systemd-resolved.service.m4.in b/units/systemd-resolved.service.m4.in
index c674b27ced..8e1c1dea79 100644
--- a/units/systemd-resolved.service.m4.in
+++ b/units/systemd-resolved.service.m4.in
@@ -8,6 +8,9 @@
[Unit]
Description=Network Name Resolution
Documentation=man:systemd-resolved.service(8)
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/resolved
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
After=systemd-networkd.service network.target
# On kdbus systems we pull in the busname explicitly, because it