[systemd-commits] 5 commits - TODO man/systemd.network.xml src/core src/shared src/sysctl
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Apr 24 11:09:31 PDT 2015
TODO | 9 +++++++++
man/systemd.network.xml | 22 ++++++++++++++++++++--
src/core/unit.c | 8 +++-----
src/shared/sysctl-util.c | 26 +++++++++-----------------
src/sysctl/sysctl.c | 14 +++++++-------
5 files changed, 48 insertions(+), 31 deletions(-)
New commits:
commit 0f5a8be5fe6feb56fa306a793be7230fa630b93c
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 24 19:56:24 2015 +0200
sysctl: minor simplifications
diff --git a/src/shared/sysctl-util.c b/src/shared/sysctl-util.c
index 650c9c9..55f4e48 100644
--- a/src/shared/sysctl-util.c
+++ b/src/shared/sysctl-util.c
@@ -58,31 +58,23 @@ char *sysctl_normalize(char *s) {
}
int sysctl_write(const char *property, const char *value) {
- _cleanup_free_ char *p = NULL;
- char *n;
-
- log_debug("Setting '%s' to '%s'", property, value);
+ char *p;
- p = new(char, strlen("/proc/sys/") + strlen(property) + 1);
- if (!p)
- return log_oom();
+ assert(property);
+ assert(value);
- n = stpcpy(p, "/proc/sys/");
- strcpy(n, property);
+ log_debug("Setting '%s' to '%s'", property, value);
+ p = strjoina("/proc/sys/", property);
return write_string_file(p, value);
}
int sysctl_read(const char *property, char **content) {
- _cleanup_free_ char *p = NULL;
- char *n;
-
- p = new(char, strlen("/proc/sys/") + strlen(property) + 1);
- if (!p)
- return log_oom();
+ char *p;
- n = stpcpy(p, "/proc/sys/");
- strcpy(n, property);
+ assert(property);
+ assert(content);
+ p = strjoina("/proc/sys/", property);
return read_full_file(p, content, NULL);
}
commit e50b33bebdfd9ab38f037fbdb38445c64d3aae98
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 24 19:55:16 2015 +0200
sysctl: don't propagate ENOENT sysctl options
We shouldn't fail the sysctl service if an option is missing.
Previously the warning about this was already downgraded to LOG_DEBUG,
but we really shouldn't propagate such errors either.
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 43c765f..fe277a2 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -42,24 +42,23 @@ static char **arg_prefixes = NULL;
static const char conf_file_dirs[] = CONF_DIRS_NULSTR("sysctl");
static int apply_all(Hashmap *sysctl_options) {
- int r = 0;
char *property, *value;
Iterator i;
-
- assert(sysctl_options);
+ int r = 0;
HASHMAP_FOREACH_KEY(value, property, sysctl_options, i) {
int k;
k = sysctl_write(property, value);
if (k < 0) {
- log_full(k == -ENOENT ? LOG_DEBUG : LOG_WARNING,
- "Failed to write '%s' to '%s': %s", value, property, strerror(-k));
+ log_full_errno(k == -ENOENT ? LOG_DEBUG : LOG_WARNING, k,
+ "Failed to write '%s' to '%s': %m", value, property);
- if (r == 0)
+ if (r == 0 && k != -ENOENT)
r = k;
}
}
+
return r;
}
@@ -208,13 +207,14 @@ static int parse_argv(int argc, char *argv[]) {
* we need to keep compatibility. We now support any
* sysctl name available. */
sysctl_normalize(optarg);
+
if (startswith(optarg, "/proc/sys"))
p = strdup(optarg);
else
p = strappend("/proc/sys/", optarg);
-
if (!p)
return log_oom();
+
if (strv_consume(&arg_prefixes, p) < 0)
return log_oom();
commit 742f41adb1b7251fcdf2201632c2a980282cdcc4
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 24 19:54:29 2015 +0200
core: minor simplification
diff --git a/src/core/unit.c b/src/core/unit.c
index 730492e..496db6c 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3643,11 +3643,9 @@ int unit_require_mounts_for(Unit *u, const char *path) {
if (!x) {
char *q;
- if (!u->manager->units_requiring_mounts_for) {
- u->manager->units_requiring_mounts_for = hashmap_new(&string_hash_ops);
- if (!u->manager->units_requiring_mounts_for)
- return -ENOMEM;
- }
+ r = hashmap_ensure_allocated(&u->manager->units_requiring_mounts_for, &string_hash_ops);
+ if (r < 0)
+ return r;
q = strdup(prefix);
if (!q)
commit 07cc65c70150faa68a63a444d615f922517c7d94
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 24 19:54:14 2015 +0200
Update TODO
diff --git a/TODO b/TODO
index 74e804f..48ecd06 100644
--- a/TODO
+++ b/TODO
@@ -46,6 +46,15 @@ Before 220:
Features:
+* nspawn: add a logic for cleaning up read-only, hidden container images in /var/lib/machines that are not ancestors of any non-hidden containers
+
+* nspawn: Improve error message when --bind= is used on a non-existing source directory
+
+* nspawn: maybe make copying of /etc/resolv.conf optional, and skip it if --read-only is used
+
+* man: document how update dkr images works with machinectl
+ http://lists.freedesktop.org/archives/systemd-devel/2015-February/028630.html
+
* nspawn: as soon as networkd has a bus interface, hook up --network-interface= with networkd, to trigger netdev creation should an interface be missing
* networkd: make DHCP server IP range configurable, including only with a single IP address
commit 4046d8361c55c80ab8577aea52523b9e6eab0d0c
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 24 19:53:38 2015 +0200
man: extend documentation on IPForward= and IPMasquerade=
Mention the default values, and clarify how this relates to the
underlying sysctls.
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 087e9e2..c7e4db4 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -358,7 +358,24 @@
the routing table. Takes either a boolean argument, or the
values <literal>ipv4</literal> or <literal>ipv6</literal>,
which only enables IP forwarding for the specified address
- family.</para></listitem>
+ family. This controls the
+ <filename>net.ipv4.conf.<interface>.forwarding</filename>
+ and
+ <filename>net.ipv6.conf.<interface>.forwarding</filename>
+ sysctl options of the network interface (see <ulink
+ url="https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt">ip-sysctl.txt</ulink>
+ for details about sysctl options). Defaults to
+ <literal>no</literal>.</para>
+
+ <para>Note: unless this option is turned on, no IP
+ forwarding is done on this interface, even if this is
+ globally turned on in the kernel, with the
+ <filename>net.ipv4.ip_forward</filename> and
+ <filename>net.ipv4.ip_forward</filename> sysctl
+ options. Also, if this option is enabled for at least one
+ interface, the global options in the kernel are also enabled
+ as necessary, to ensure IP forwarding can take place.</para>
+ </listitem>
</varlistentry>
<varlistentry>
<term><varname>IPMasquerade=</varname></term>
@@ -366,7 +383,8 @@
interface. If enabled packets forwarded from the network
interface will be appear as coming from the local host.
Takes a boolean argument. Implies
- <varname>IPForward=yes</varname>.</para></listitem>
+ <varname>IPForward=yes</varname>. Defaults to
+ <literal>no</literal>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Bridge=</varname></term>
More information about the systemd-commits
mailing list