[systemd-devel] Systemd and network devices under LXC?

Lars Kellogg-Stedman lars at oddbit.com
Wed Jan 23 21:29:41 PST 2013


I am running Linux under LXC. I have a systemd unit file for dhcpcd (a
DHCP client) that includes:

  BindsTo=sys-subsystem-net-devices-eth0.device

And indeed, eth0 exists and is functioning:

  # ip link show eth0
  35: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UP mode DEFAULT qlen 1000
      link/ether 00:16:3e:05:24:4e brd ff:ff:ff:ff:ff:ff

Systemd (197) does not appear to be aware of this interface, and
ultimately gives up with the following error:

  Timed out waiting for device sys-subsystem-net-devices-eth0.device.

This is what udevadm says about the interface:

  # udevadm info /sys/class/net/eth0
  P: /devices/virtual/net/eth0
  E: DEVPATH=/devices/virtual/net/eth0
  E: IFINDEX=35
  E: INTERFACE=eth0
  E: SUBSYSTEM=net

Why doesn't systemd know about this interface? I would like to avoid
modifying the existing service file (because it will probably get
tromped on by a package upgrade, and because having the service
depdend on the network interface makes an awful lot of sense).  I
understand that this may be a udev problem, and there are posts out
there indicating that udev had problems running in a container...but
udev has since been folded into systemd, and systemd-udev at least
*claims* to be running.


More information about the systemd-devel mailing list