[lxc-devel] lxc-start does not return the exit code from the container

Rodrigo Vaz rodrigo at heroku.com
Tue Jul 1 21:36:48 UTC 2014


Hi,

I've started testing lxc 1.0.4 on our environment with ubuntu trusty images
and found an issue with the exit code of lxc-start.

On lxc 0.9.0 the exit code matches the container:

vagrant at vagrant-ubuntu-trusty-64:~$ sudo lxc-start -l debug -o lxc.log -n
u1 -- bash -c 'echo TEST && sleep 10 && exit 143'
TEST
vagrant at vagrant-ubuntu-trusty-64:~$ echo $?
143

Running the same test on lxc 1.0.4:

root at runtime.21 ~# lxc-start -l debug -o lxc.log -n u1 -- bash -c 'echo
TEST && sleep 10 && exit 143'
TEST
lxc-start: The container failed to start.
lxc-start: Additional information can be obtained by setting the --logfile
and --log-priority options.
root at runtime.21 ~# echo $?
1

lxc.log says:

     lxc-start 1404250316.378 INFO     lxc_error - child <18118> ended on
error (143)
      lxc-start 1404250316.378 WARN     lxc_conf - failed to remove
interface '(null)'
      lxc-start 1404250316.382 ERROR    lxc_start_ui - The container failed
to start.
      lxc-start 1404250316.382 ERROR    lxc_start_ui - Additional
information can be obtained by setting the --logfile and --log-priority
options.

This was reproducible on the same machine using lxc 0.9.0 and 1.0.4.

Has anything changed recently regarding exit codes?

Regards,

Rodrigo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140701/0374f510/attachment.html>


More information about the lxc-devel mailing list