Comment 4 for bug 810044

Revision history for this message
Scott Moser (smoser) wrote :

@clint,
  I think there is an issue with the branch you've been working on when mappings are used.
  I've fixed my branch to use the first token of /var/run/network/ifstate rather than the second. Experimentation showed that the first field will be the physical interface and the second would be the virtual. 'auto' lines in interfaces reference virtual.

  That would seem to be fine, but my issue right now is that 'ifquery --list' does not show any interfaces that have had mappings done. Sadly:

$ cat /etc/network/interfaces
auto eth0
mapping eth0
  script /usr/local/bin/print-last
  map AUTO xdhcp
  map MANUAL xmanual
iface xdhcp inet dhcp
iface xmanual inet static
  address 192.168.42.1
  netmask 255.255.255.0

$ cat /usr/local/bin/print-last
#!/bin/sh
while read name val; do last=$val; done
echo $last

$ sudo ifquery --list
lo
Ignoring unknown interface eth0=eth0.

$ sudo ifup eth0
$ cat /var/run/network/ifstate
lo=lo
eth0=xmanual

$ sudo ifquery --list
lo
Ignoring unknown interface eth0=eth0.

The 'Ignoring' message goes to stderr.

The issue, is that with the current implementation, the 'static-network-up' would fire as soon as 'lo' was up. Because the 'ifquery --list' is not providing a complete list to stdout as expected.