[lxc-users] upstart delay in container

Christoph Lehmann lemming at christophlehmann.eu
Sun Jul 12 13:44:09 UTC 2015


Hi list,

i use lxc 1.1.2-0ubuntu3~ubuntu14.04.1~ppa1 and in my unprivileged 
container (ubuntu/trusty) i have an Apache webserver. The container 
starts normally but the webserver process comes up after several minutes.

Why is there such a big delay? Am i missing something?

My init-script looks like this:

root at web:/# cat /etc/init/apache2.conf
# apache2 - http server
#
# Apache is a web server that responds to HTTP and HTTPS requests.
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
description "apache2 http server"
start on runlevel [2345]
stop on runlevel [!2345]
pre-start script
     mkdir -p /var/run/apache2 || true
     install -d -o www-data /var/lock/apache2 || true
     # ssl_scache shouldn't be here if we're just starting up.
     # (this is bad if there are several apache2 instances running)
     rm -f /var/run/apache2/*ssl_scache* || true
end script
env APACHE_RUN_USER=www-data
env APACHE_RUN_GROUP=www-data
env APACHE_PID_FILE=/var/run/apache2.pid
# Give up if restart occurs 10 times in 30 seconds.
respawn limit 10 30
exec /usr/sbin/apache2 -D NO_DETACH
respawn

And the container template:

vagrant at vagrant-ubuntu-trusty-64:~$ cat .local/share/lxc/web/config
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
lxc.include = /usr/share/lxc/config/ubuntu.userns.conf
lxc.arch = x86_64
# Container specific configuration
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:37:0f:76
# Own configuration
lxc.network.ipv4 = 10.0.3.11/24
lxc.network.ipv4.gateway = 10.0.3.1
lxc.start.auto = 1
lxc.cap.drop = mac_override net_admin
lxc.rootfs = 
overlayfs:/home/vagrant/.local/share/lxc/base/rootfs:/home/vagrant/.local/share/lxc/web/delta0 

lxc.utsname = web
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150712/16127704/attachment.html>


More information about the lxc-users mailing list