core: clone_device_node(): add debug message
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 18 Jan 2018 13:58:13 +0000 (13:58 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 18 Jan 2018 13:58:13 +0000 (13:58 +0000)
For people who use debug messages, maybe it is helpful to know that
PrivateDevices= failed due to mknod(), and which device node.

(The other (un-logged) failures could be while mounting filesystems e.g. no
CAP_SYS_ADMIN which is the common case, or missing /dev/shm or /dev/pts,
or missing /dev/ptmx).

src/core/namespace.c

index d6c1b1b..e1a9d7a 100644 (file)
@@ -523,7 +523,7 @@ static int clone_device_node(const char *d, const char *temporary_mount) {
         mac_selinux_create_file_clear();
 
         if (r < 0)
-                return -errno;
+                return log_debug_errno(errno, "mknod failed for %s: %m", d);
 
         return 0;
 }