Bug 36148 - systemd-nspawn always returns 1
Summary: systemd-nspawn always returns 1
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-12 00:15 UTC by Dennis Wronka
Modified: 2011-04-19 19:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.