问题:LXC container 启动不了,卡在Starting configure network device界面
sh: 0: getcwd() Failed: No such file or directory
<4>init: hostname main process (3) terminated with status 1
<4>init: plymouth-upstart-bridge main process (5) terminated with status 1
<4>init: plymouth-upstart-bridge main process ended,respawning
<4>init: plymouth-upstart-bridge main process (14) terminated with status 1
<4>init: plymouth-upstart-bridge main process ended,respawning
* Starting Mount filesystems on boot ...done.
* Stopping Send an event to indicate plymouth is up ...done.
* Starting Signal sysvinit that the rootfs is mounted ...done.
* Starting Clean /tmp directory ...done.
* Starting Populate and link to /run filesystem ...done.
* Starting Track if upstart is running in a container ...done.
* Stopping Clean /tmp directory ...done.
* Stopping Populate and link to /run filesystem ...done.
* Starting load fallback graphics devices ...done.
* Starting workaround for missing events in container ...done.
<4>init: udev-fallback-graphics main process (77) terminated with status 1
* Starting load fallback graphics devices ...fail!
* Starting userspace bootsplash ...done.
* Starting Send an event to indicate plymouth is up ...done.
* Starting configure network device security ...done.
* Stopping workaround for missing events in container ...done.
* Starting Initialize or finalize resolvconf ...done.
* Stopping Send an event to indicate plymouth is up ...done.
* Starting Mount network filesystems ...done.
* Stopping Mount network filesystems ...done.
* Stopping userspace bootsplash ...done.
* Starting Bridge socket events into upstart ...done.
* Starting configure network device ...done.
lxc 版本:
sudo lxc-ls --version
1.0.9
分析:
从https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1307431发现是下面问题:
That old config doesn’t mount pstore which is then causing the hang at boot time which you are seeing
也即 旧的配置文件并没有挂载pstore文件
解决方法:
1、在config文件中直接包含ubuntu通用的配置文件:
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
相关帖子:
http://serverfault.com/questions/571714/setting-up-bridged-lxc-containers-with-static-ips