After the reboot runlevel inside of container is
unknown and most of services are not running:
[root@pcs ~]# vzctl enter 100500 entered into Container 100500 root@container:/# su - root@container:~# runlevel unknown
Upstart fails to invoke
rc-sysinit job which is responsible for starting most of the services. This job depends on
networking job and
mountall job is failing because /etc/fstab contains bind-mounts with
_netdev mount option:
root@container:/etc/init# grep netdev /etc/fstab /var/log/ispconfig/httpd/thepiratebay.se /var/www/clients/client1/web3/log none bind,nobootwait,_netdev 0 0 /var/log/ispconfig/httpd/google.com /var/www/clients/client3/web9/log none bind,nobootwait,_netdev 0 0 /var/log/ispconfig/httpd/microsoft.com /var/www/clients/client1/web10/log none bind,nobootwait,_netdev 0 0
mountall job does not receive signal from
udev telling that "network devices are up", thus initialization of
_netdev mounts never takes place, and
upstart is not receiving
filesystem event, therefore further initialization of the system is blocked.
Issue is not reproducible on Ubuntu 14.04, thus it is considered to be a bug in upstart which is already addressed in latest version.
Issue can be workarounded by adjusting
pre-cache script of the corresponding template:
[root@benderbrau default]# pwd /vz/template/ubuntu/12.04/x86_64/config/os/default [root@pcs default]# diff -pruN pre-cache.original pre-cache --- pre-cache.original 2014-09-24 02:11:15.468613183 +0700 +++ pre-cache 2014-09-24 02:11:38.358030950 +0700 @@ -109,4 +109,10 @@ gnats:x:41:41:Gnats Bug-Reporting System nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh" > etc/passwd +echo " +pre-start script + initctl emit filesystem -n || true +end script +" >> etc/init/mountall.conf + popd > /dev/null
This patch will automate the workaround, which is, to emit "filesystem" inside of "mountall" job unconditionally, just like it is performed in Ubuntu 10.04.
After you update
pre-cache script it will be necessary to update the template cache as well:
# vzpkg update cache ubuntu-12.04-x86_64
Workaround will help for new containers, and for existing containers following workaround should help (just copy following lines and insert them in console while you're logged into the container via ssh or
echo " pre-start script initctl emit filesystem -n || true end script" >> /etc/init/mountall.conf