<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi list,<br>
<br>
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.<br>
<br>
Why is there such a big delay? Am i missing something?<br>
<br>
My init-script looks like this:<br>
<br>
root@web:/# cat /etc/init/apache2.conf
<br>
# apache2 - http server
<br>
#
<br>
# Apache is a web server that responds to HTTP and HTTPS requests.
<br>
# Required-Start: $local_fs $remote_fs $network $syslog
<br>
# Required-Stop: $local_fs $remote_fs $network $syslog
<br>
description "apache2 http server"
<br>
start on runlevel [2345]
<br>
stop on runlevel [!2345]
<br>
pre-start script
<br>
mkdir -p /var/run/apache2 || true
<br>
install -d -o www-data /var/lock/apache2 || true
<br>
# ssl_scache shouldn't be here if we're just starting up.
<br>
# (this is bad if there are several apache2 instances running)
<br>
rm -f /var/run/apache2/<b class="moz-txt-star"><span
class="moz-txt-tag">*</span>ssl_scache<span class="moz-txt-tag">*</span></b>
|| true
<br>
end script
<br>
env APACHE_RUN_USER=www-data
<br>
env APACHE_RUN_GROUP=www-data
<br>
env APACHE_PID_FILE=/var/run/apache2.pid
<br>
# Give up if restart occurs 10 times in 30 seconds.
<br>
respawn limit 10 30
<br>
exec /usr/sbin/apache2 -D NO_DETACH
<br>
respawn<br>
<br>
And the container template: <br>
<br>
vagrant@vagrant-ubuntu-trusty-64:~$ cat .local/share/lxc/web/config
<br>
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
<br>
lxc.include = /usr/share/lxc/config/ubuntu.userns.conf
<br>
lxc.arch = x86_64
<br>
# Container specific configuration
<br>
lxc.id_map = u 0 100000 65536
<br>
lxc.id_map = g 0 100000 65536
<br>
# Network configuration
<br>
lxc.network.type = veth
<br>
lxc.network.flags = up
<br>
lxc.network.link = lxcbr0
<br>
lxc.network.hwaddr = 00:16:3e:37:0f:76
<br>
# Own configuration
<br>
lxc.network.ipv4 = 10.0.3.11/24
<br>
lxc.network.ipv4.gateway = 10.0.3.1
<br>
lxc.start.auto = 1
<br>
lxc.cap.drop = mac_override net_admin
<br>
lxc.rootfs = overlayfs:<i class="moz-txt-slash"><span
class="moz-txt-tag">/</span>home/vagrant<span
class="moz-txt-tag">/</span></i>.local/share/lxc/base/rootfs:<i
class="moz-txt-slash"><span class="moz-txt-tag">/</span>home/vagrant<span
class="moz-txt-tag">/</span></i>.local/share/lxc/web/delta0
<br>
lxc.utsname = web
<br>
</body>
</html>