aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/namespaces.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-02-07 23:01:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-02-07 23:01:39 +0100
commit0a70b411e1afaa22d8b01560de908246042daf10 (patch)
tree75d1d9250385652a4bbbb56f03eb75e86ecef5aa /src/libutil/namespaces.cc
parentc5c0617d6fe6810c35ec56d3116ef523f3f38904 (diff)
Print debug message if a namespace test fails
Diffstat (limited to 'src/libutil/namespaces.cc')
-rw-r--r--src/libutil/namespaces.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libutil/namespaces.cc b/src/libutil/namespaces.cc
index b1cdbfe03..fdd52d92b 100644
--- a/src/libutil/namespaces.cc
+++ b/src/libutil/namespaces.cc
@@ -39,7 +39,12 @@ bool userNamespacesSupported()
_exit(res ? 1 : 0);
});
- return pid.wait() == 0;
+ bool supported = pid.wait() == 0;
+
+ if (!supported)
+ debug("user namespaces do not work on this system");
+
+ return supported;
}();
return res;
}
@@ -56,7 +61,12 @@ bool mountNamespacesSupported()
_exit(res ? 1 : 0);
});
- return pid.wait() == 0;
+ bool supported = pid.wait() == 0;
+
+ if (!supported)
+ debug("mount namespaces do not work on this system");
+
+ return supported;
}();
return res;
}