It appears as if systemd-nspawn always returns 1, unlike what the man-page says that it returns whatever the called process in the container returns. Still looking at the code, but I suspect the problem to be in util.c
Crawling through the code it seems that the int r, which is returned by systemd-nspawn is only set once after being initialized with EXIT_FAILURE. line 586: if ((r = parse_argv(argc, argv)) <= 0) After that a lot of stuff happens, but nothing re-assigns r The next block that may re-assign r starts in line 777: r = wait_for_terminate_and_warn(argc > optind ? argv[optind] : "bash", pid); if (r < 0) r = EXIT_FAILURE; But this never happens because in line 769 this happens: if (process_pty(master, &mask) < 0) goto finish;
Thanks, fixed in git.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.