<div dir="ltr">On Fri, Apr 12, 2013 at 6:53 AM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Quoting Somnath Mitra (<a href="mailto:somnath.mitra@xockets.com" target="_blank">somnath.mitra@xockets.com</a>):<br></blockquote>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> Since the container rootfs is shared with host I am confused why it cannot<br>
> find lxc-init?<br>
<br>
</div></div>Sounds like a compilation/packaging problem. It works for me<br>
here, with ubuntu raring:<br>
<br>
cat > lxc.conf << EOF<br>
lxc.utsname = beta<br>
lxc.network.type = empty<br>
lxc.rootfs = /<br>
lxc.aa_profile = unconfined<br>
EOF<br>
<br>
sudo lxc-execute -n foobar -f lxc.conf -l info -o outout -- ps -ef<br>
UID PID PPID C STIME TTY TIME CMD<br>
root 1 0 0 08:46 pts/1 00:00:00 /usr/lib/x86_64-linux-gnu/lxc/lxc-init -- ps -ef<br>
root 2 1 0 08:46 pts/1 00:00:00 ps -ef<br>
<br>
(an interactive shell doesn't work - just hangs, I don't use<br>
lxc-execute so always forget what is expect to work and what<br>
isn't)<br></blockquote><div><br></div><div>Hangs for me too (on the embedded board). Can you comment on possible root cause or workaround so we can investigate. My target application shall need stdin, stdout and, possibly, stderr.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
> I have already checked that kernel is configured correctly using<br>
> lxc-checkconfig.<br>
><br>
> Pls send a pointer to a simple working configuration for embedded systems.<br>
<br>
</div>Take a look at src/lxc/execute.c:choose_init(). It will look for<br>
lxc-init in three places:<br>
<br>
LXCINITDIR "/lxc/lxc-init"<br>
/usr/lib/lxc/lxc-init<br>
/sbin/lxc-init<br>
<br>
LXCINITDIR in ubuntu is /usr/lib/x86_64-linux-gnu, and lxc-init is in<br>
fact at /usr/lib/x86_64-linux-gnu/lxc/lxc-init. (You can find your<br>
LXCINITDIR in config.log if you built your own lxc). But the<br>
easier thing might be to just copy lxc-init into /sbin.<br></blockquote><div><br></div><div>Yes I had put lxc-* binaries in /usr/bin. Putting them in /sbin solved it.</div><div><br></div><div>Thanks,<br>
SM.</div></div></div></div>