Bug 36148

Summary: systemd-nspawn always returns 1
Product: systemd Reporter: Dennis Wronka <dennis.wronka>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Dennis Wronka 2011-04-12 00:15:59 UTC
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
Comment 1 Dennis Wronka 2011-04-13 00:53:04 UTC
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;
Comment 2 Lennart Poettering 2011-04-19 19:12:39 UTC
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.