[Lxc-users] LXC on ubuntu precise and dhclient/net config

Stéphane Graber stgraber at ubuntu.com
Mon Jun 11 17:07:19 UTC 2012


On 06/11/2012 12:50 PM, Stéphane Graber wrote:
> On 06/10/2012 02:51 PM, Vasiliy Molostov wrote:
>> The issue was related to upstart job ordering, since new isc-dhcp-server job 
>> configuration does not relate to lxc startup nor other valuable condition 
>> other than rclevel, and with lxc-net disabled the lxc service job starts 
>> unrelatedly to the available dhcpd server startup on the same host. Perhaps 
>> this is not the issue for most installations, but for my case this was 
>> errorneous. I dont know how to figure out dependency on isc-dhcp-server in 
>> upstart jobs.
> 
> I don't see a good way of dealing with this automatically.
> 
> I think the best is to document that in such case you'll want to
> configure /etc/default/isc-dhcp-server to listen only on the required
> interfaces (and not on lxcbr0).

Sorry, only saw your LP bug and read the rest of the thread now. While
the above may still be somewhat relevant (conflict between isc-dhcp and
lxc), it's not what you're actually reporting.

I don't think there's currently any easy way of getting lxc to wait for
the dhcp server to be ready before starting the containers as we can't
get upstart to conditionally depend on an event. That's why our default
setup is to start our own controlled network and DHCP/DNS server.

The new upstart file bridge that should land in 12.10 might help there,
though I'm not sure what the condition would be like.

Some additional tricks could also be added to the pre-start statement to
try and wait for the needed services but I don't see this happening in
the near future because of the complexity of some setups.

For example, what would you do in the case where isc-dhcp-server depends
on an external LDAP server, how can you detect this and how would you
check that the LDAP server will indeed work?
Also, what would you do if isc-dhcp-server fails to start? just not
start lxc? but that'd be wrong in cases where some lxc containers have
static IPs or where they are using lxc's own bridge.


Anyway, I had a quick look at the jobs again as I wrote them a while ago
and can't say I remember them perfectly. These were indeed proper port
of the sysvinit jobs, I don't see any potentially race condition caused
by that port that wouldn't have existed before.


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120611/88f21d6f/attachment.pgp>


More information about the lxc-users mailing list