ifupdown-ng / ifupdown-ng

flexible ifup/ifdown implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ifquery compat with traditional ifupdown

DanielG opened this issue · comments

Hi,

I'm looking into how viable using ifupdown-ng as a drop-in replacement for traditional ifupdown is on Debian. I've found the output of ifquery <interface> to be incompatible.

ifupdown prints stanza commands like this:

$ ifquery dummy0
pre-up: ip link add $IFACE type dummy
post-down: ip link del $IFACE
up:  ...
down: ...

whereas ifupdown-ng prints the syntax used in interfaces:

$ ifquery dummy0
auto dummy0              
iface dummy0
  use link
  pre-up ip link add $IFACE type dummy
  use pre
  post-down ip link del $IFACE
  use post
  up ...
  down ...

It seems to me the (new) ifparse <interface> is what should be used to print the interfaces syntax (as it already does) and ifquery should maintain compatibility with ifupdown so as to not break scripts.

--Daniel

In this case, our ifquery follows the behavior of Cumulus' ifupdown2 as Alpine's original implementation did not have ifquery and therefore I was unaware of the original implementation also having an ifquery.

I agree that changing it to align with ifupdown1 syntax is probably the move here.

Sounds good. I'll try to send a patch soon.