[lxc-users] busybox template in ubuntu 14.04 fails to install /usr/sbin/init.lxc?
Fajar A. Nugraha
list at fajar.net
Mon May 12 12:19:10 UTC 2014
On Mon, May 12, 2014 at 10:25 AM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> Quoting Fajar A. Nugraha (list at fajar.net):
>> It is also not a straightforward matter to copy init.lxc. In ubuntu
>> trusty at least, I had to copy to other libraries manually to a ubuntu
>> container to make it work: liblxc.so.1 and libseccomp.so.2. For a
>
> this difficulty is really bothering me so i'm thinking of teaching
> lxc-execute to look for /usr/sbin/init.lxc.static on the host, and
> binding that into the container automatically at start. (Then probably
> publishing init.lxc.static in a new package).
In the mean time, I found something odd on a system: having init.lxc
as sylmink to /bin/bash doesn't work. Not sure why, as the same thing
works on another system (both trusty). Copying the real init.lxc (plus
dependencies) from the host works, as expected.
I was able to test that you CAN use busybox (I tested the
busybox-static) as init.lxc. Not with symlink, but with a script.
# cat usr/sbin/init.lxc
#!/bin/busybox ash
shift
"$@"
chmod 755, and it works ("trusty" is the host, "template" is the container)
trusty ~ # lxc-execute -n template -- sudo -i
template ~ # ps -efa
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 12:11 ? 00:00:00 /bin/busybox ash
/usr/sbin/init.lxc -- sudo -i
root 4 1 0 12:11 ? 00:00:00 sudo -i
root 5 4 0 12:11 ? 00:00:00 -bash
root 23 5 0 12:11 ? 00:00:00 ps -efa
template ~ # logout
trusty ~ #
Note that when you do it this way, the output of some commands can be
different than what you'd expect due to busybox prioritizing it's
internal module. For example, If I pass "ps -efa" directly instead of
in the interactive shell after sudo:
trusty ~ # lxc-execute -n template -- ps -efa
PID USER COMMAND
1 root {init.lxc} /bin/busybox ash /usr/sbin/init.lxc -- ps -efa
4 root {busybox} ps -efa
--
Fajar
More information about the lxc-users
mailing list