[systemd] Factorize lxcbr0 setup and use it for all init systems
Bug #1312532 reported by
Martin Pitt
This bug affects 6 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Low
|
Martin Pitt |
Bug Description
With booting systemd, starting containers fails:
$ sudo lxc-start -n debci
lxc-start: failed to attach 'vethQFOOY3' to the bridge 'lxcbr0' : No such device
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'debci'
Presumably that's because LXC currently only ships upstart jobs to set up the bridges:
/etc/
/etc/
/etc/
These need corresponding systemd units.
summary: |
- [systemd] Container startup fails on missing lxcbr0 + [systemd] Factorize lxcbr0 setup and use it for all init systems |
To post a comment you must log in.
For the record: I turned /etc/init/ lxc-net. conf into a shell script that you call with "start" or "stop". With that we can keep the logic in one place, and the upstart/ systemd/ init.d script would just call this. That sets up the lxcbr interface etc. I also ran the apparmor bits from /etc/init/lxc.conf, but even that isn't enough:
$ sudo lxc-start -n debci use_hierarchy to 1; continuing use_hierarchy to 1; continuing x86_64- linux-gnu/ lxc/dev/ lxc/console
lxc-start: Device or resource busy - failed to set memory.
lxc-start: Device or resource busy - failed to set memory.
lxc-start: Permission denied - Failed to make / rslave
lxc-start: Continuing...
lxc-start: Input/output error - error 5 creating /usr/lib/
lxc-start: failed to setup the console for 'debci'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn 'debci'
Corresponding kernel messages from that:
$ dmesg NETDEV_ UP): veth6OE62S: link is not ready 7.278:78) : apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile= "/usr/bin/ lxc-start" name="/" pid=4371 comm="lxc-start" flags="rw, rslave" NETDEV_ CHANGE) : veth6OE62S: link becomes ready
[ 1733.458729] device veth6OE62S entered promiscuous mode
[ 1733.459332] IPv6: ADDRCONF(
[ 1733.503547] type=1400 audit(139844057
[ 1733.527581] IPv6: ADDRCONF(
[ 1733.527672] lxcbr0: port 1(veth6OE62S) entered forwarding state
[ 1733.527697] lxcbr0: port 1(veth6OE62S) entered forwarding state
[ 1733.947690] lxcbr0: port 1(veth6OE62S) entered disabled state
[ 1733.948400] device veth6OE62S left promiscuous mode
[ 1733.948416] lxcbr0: port 1(veth6OE62S) entered disabled state
Certainly the AppArmor violation is the crucial bit here. It might behave slightly differently when running under systemd.