lxc-start-ephemeral masks process exit code

Bug #1059943 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
New
Undecided
Unassigned

Bug Description

lxc-start-ephemeral command
e.g. lxc-start-ephemeral run-my-tests

does 'exit 0' after running the command - see handle_container.

This masks the exit code the command provides, and makes rnuning commands via fail in hard to programmatically diagnose ways. ssh, the underlying remote-execution tool used, *does* preserve exit code:
robertc@lifeless-64:~$ ssh -n localhost -- 'exit 1'
robertc@lifeless-64:~$ echo $?
1
robertc@lifeless-64:~$ ssh -n localhost -- 'exit 0'
robertc@lifeless-64:~$ echo $?
0

So it should be very straight forward to capture the exit code and propogate it out of the script. IIRC our prototype versions did this implicitly, and its been lost since.

This bugs affects the robustness of the Launchpad test suite under lxc.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.