[lxc-users] Cannot seem to get a customized template to work correctly

Nels Nelson nels.n.nelson at gmail.com
Mon Mar 17 16:08:14 UTC 2014


No matter what I try to do, it seems that the template that I am using does
not properly start a container using /sbin/init, and fails without error
but only the warning: "lxc_start - invalid pid for SIGCHLD".  I've tried a
variety of different commands within the template in order to start the
container, including

    exec /usr/lib/lxc/lxc-init -- /bin/ls
    exec /usr/lib/lxc/lxc-init -- /usr/bin/watch /bin/ls /

and so on, but the results are always the same.

Running the following commands

    # lxc-create -t minimal -n test -l DEBUG -o /tmp/lxc.log
    # lxc-start -d -n test -l DEBUG -o /tmp/lxc.log

results in the following output in the logs

      lxc-start 1392050744.235 NOTICE   lxc_start - exec'ing '/sbin/init'
      lxc-start 1392050744.237 NOTICE   lxc_start - '/sbin/init' started
with pid '27985'
      lxc-start 1392050744.237 WARN     lxc_start - invalid pid for SIGCHLD
      lxc-start 1392050744.239 DEBUG    lxc_commands - peer has disconnected
      lxc-start 1392050744.239 DEBUG    lxc_commands - 'test' is in
'RUNNING' state
      lxc-start 1392050744.240 DEBUG    lxc_commands - peer has disconnected
      lxc-start 1392050744.274 DEBUG    lxc_start - container init process
exited
      lxc-start 1392050744.274 INFO     lxc_conf - running to reset 0 nic
names

I have even tried having lxc-init run a script that invokes a daemon.

    exec /usr/lib/lxc/lxc-init -- /tmp/boringd

Where boringd is

    #! /usr/bin/env bash
    /usr/bin/daemon -- watch ls /tmp

Here is the full template:

https://gist.github.com/nelsnelson/9601966

And here is the full log:

https://gist.github.com/nelsnelson/9601987

What am I doing wrong here?

I suppose I really don't understand how a lxc container is supposed to get
created and started based on the specifications of a template.

Are there any in-depth tutorials or documentation available on template
design and construction and how they are supposed to be used?

Thanks,
-Nels
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140317/f4566c98/attachment.html>


More information about the lxc-users mailing list