[systemd-commits] src/nspawn.c
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Mar 5 17:07:22 PST 2012
src/nspawn.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 52af21063b365f231ee6ae8bac18d690fff85799
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 6 02:06:29 2012 +0100
nspawn: be less cryptic when clone() fails
Based on a patch suggested by Shawn Landden.
diff --git a/src/nspawn.c b/src/nspawn.c
index b8b379d..b548b12 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -706,8 +706,13 @@ int main(int argc, char *argv[]) {
sigset_add_many(&mask, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, -1);
assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0);
- if ((pid = syscall(__NR_clone, SIGCHLD|CLONE_NEWIPC|CLONE_NEWNS|CLONE_NEWPID|CLONE_NEWUTS|(arg_private_network ? CLONE_NEWNET : 0), NULL)) < 0) {
- log_error("clone() failed: %m");
+ pid = syscall(__NR_clone, SIGCHLD|CLONE_NEWIPC|CLONE_NEWNS|CLONE_NEWPID|CLONE_NEWUTS|(arg_private_network ? CLONE_NEWNET : 0), NULL);
+ if (pid < 0) {
+ if (errno == EINVAL)
+ log_error("clone() failed, do you have namespace support enabled in your kernel? (You need UTS, IPC, PID and NET namespacing built in): %m");
+ else
+ log_error("clone() failed: %m");
+
goto finish;
}
More information about the systemd-commits
mailing list