summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO8
-rw-r--r--man/udev_device_new_from_syspath.xml35
-rw-r--r--src/basic/hashmap.c8
-rw-r--r--src/nspawn/nspawn.c11
4 files changed, 56 insertions, 6 deletions
diff --git a/TODO b/TODO
index 216dc9be0d..d629474c33 100644
--- a/TODO
+++ b/TODO
@@ -28,6 +28,14 @@ External:
Features:
+* Add PassEnvironment= setting to service units, to import select env vars from PID 1 into the service env block
+
+* nspawn: fix logic always print a final newline on output.
+ https://github.com/systemd/systemd/pull/272#issuecomment-113153176
+
+* make nspawn's --network-veth switch more powerful:
+ http://lists.freedesktop.org/archives/systemd-devel/2015-June/033121.html
+
* man: document that unless you use StandardError=null the shell >/dev/stderr won't work in shell scripts in services
* man: clarify that "machinectl show" shows different information than "machinectl status" (no cgroup tree, no IP addresses, ...)
diff --git a/man/udev_device_new_from_syspath.xml b/man/udev_device_new_from_syspath.xml
index fc147a879a..9c4ab7a1bf 100644
--- a/man/udev_device_new_from_syspath.xml
+++ b/man/udev_device_new_from_syspath.xml
@@ -136,10 +136,37 @@
<constant>c</constant> for character devices, as well as a devnum (see
<citerefentry><refentrytitle>makedev</refentrytitle><manvolnum>3</manvolnum></citerefentry>).
<function>udev_device_new_from_subsystem_sysname</function> looks up devices based
- on the provided subsystem and sysname and
- <function>udev_device_new_from_device_id</function> looks up devices based on the provided
- device id (see
- <citerefentry><refentrytitle>udev_device_get_subsystem</refentrytitle><manvolnum>3</manvolnum></citerefentry>).
+ on the provided subsystem and sysname
+ (see <citerefentry><refentrytitle>udev_device_get_subsystem</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ and
+ <citerefentry><refentrytitle>udev_device_get_sysname</refentrytitle><manvolnum>3</manvolnum></citerefentry>)
+ and <function>udev_device_new_from_device_id</function> looks up devices based on the provided
+ device id which is a special string in one of the following four forms:
+ <table>
+ <title>Device ID strings</title>
+
+ <tgroup cols='2'>
+ <colspec colname='example' />
+ <colspec colname='explanation' />
+ <thead><row>
+ <entry>Example</entry>
+ <entry>Explanation</entry>
+ </row></thead>
+ <tbody>
+ <row><entry><varname>b8:2</varname></entry>
+ <entry>block device major:minor</entry></row>
+
+ <row><entry><varname>c128:1</varname></entry>
+ <entry>char device major:minor</entry></row>
+
+ <row><entry><varname>n3</varname></entry>
+ <entry>network device ifindex</entry></row>
+
+ <row><entry><varname>+sound:card29</varname></entry>
+ <entry>kernel driver core subsystem:device name</entry></row>
+ </tbody>
+ </tgroup>
+ </table>
</para>
<para><function>udev_device_new_from_environment</function>
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index e5f05f36f8..7d2a4160c6 100644
--- a/src/basic/hashmap.c
+++ b/src/basic/hashmap.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <errno.h>
+#include <pthread.h>
#include "util.h"
#include "hashmap.h"
@@ -157,6 +158,7 @@ struct hashmap_debug_info {
/* Tracks all existing hashmaps. Get at it from gdb. See sd_dump_hashmaps.py */
static LIST_HEAD(struct hashmap_debug_info, hashmap_debug_list);
+static pthread_mutex_t hashmap_debug_list_mutex = PTHREAD_MUTEX_INITIALIZER;
#define HASHMAP_DEBUG_FIELDS struct hashmap_debug_info debug;
@@ -806,10 +808,12 @@ static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enu
}
#ifdef ENABLE_DEBUG_HASHMAP
- LIST_PREPEND(debug_list, hashmap_debug_list, &h->debug);
h->debug.func = func;
h->debug.file = file;
h->debug.line = line;
+ assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
+ LIST_PREPEND(debug_list, hashmap_debug_list, &h->debug);
+ assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
#endif
return h;
@@ -861,7 +865,9 @@ static void hashmap_free_no_clear(HashmapBase *h) {
assert(!h->n_direct_entries);
#ifdef ENABLE_DEBUG_HASHMAP
+ assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
LIST_REMOVE(debug_list, hashmap_debug_list, &h->debug);
+ assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
#endif
if (h->from_pool)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index d1154de08a..4cf2d14ae2 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1538,7 +1538,16 @@ static int setup_resolv_conf(const char *dest) {
r = copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW, 0644, 0);
if (r < 0) {
- log_warning_errno(r, "Failed to copy /etc/resolv.conf to %s: %m", where);
+ /* If the file already exists as symlink, let's
+ * suppress the warning, under the assumption that
+ * resolved or something similar runs inside and the
+ * symlink points there.
+ *
+ * If the disk image is read-only, there's also no
+ * point in complaining.
+ */
+ log_full_errno(IN_SET(r, -ELOOP, -EROFS) ? LOG_DEBUG : LOG_WARNING, r,
+ "Failed to copy /etc/resolv.conf to %s: %m", where);
return 0;
}