Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-27 Thread Ian Pilcher

On 05/23/2015 11:03 AM, Ian Pilcher wrote:

Is there a simple way to make a service require that a specific network
interface/IP address be active?

I have a manually set up bridge and dnsmasq configuration for my VM
traffic, but dnsmasq is getting started before NetworkManager has
configured the bridge and failing because it cannot bind to the bridge's
IP address.


Thanks to all for your responses.  It looks like dnsmasq's (somewhat
hidden) bind-dynamic option will work for my use case.

I am a bit surprised to find that systemd doesn't provide a way to do
this, nor does it appear to be seen as a desirable feature.  To me, this
seems like exactly the sort of asynchronous, event-driven behavior that
I would consider to be the systemd way.

(In my case, I would be waiting for a private VM traffic bridge, so the
NetworkManager or systemd-networkd wait to be online targets aren't
what I'm looking for.)

Thanks again!

--

Ian Pilcher arequip...@gmail.com
 I grew up before Mark Zuckerberg invented friendship 


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-26 Thread Lennart Poettering
On Sat, 23.05.15 11:03, Ian Pilcher (arequip...@gmail.com) wrote:

 Is there a simple way to make a service require that a specific network
 interface/IP address be active?
 
 I have a manually set up bridge and dnsmasq configuration for my VM
 traffic, but dnsmasq is getting started before NetworkManager has
 configured the bridge and failing because it cannot bind to the bridge's
 IP address.

Well, for networkd, there's the systemd-networkd-wait-online tool that
allows you to wait until a specific interface is up. Maybe NM supports
something similar? Please ask NM folks for help.

Also, dnsmasq should probably use IP_FREEBIND or so (at least
optionally) so that it can work without requiring the interface to be
up.

Either way, this is something to contact the NM and dnsmasq people
about.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-26 Thread Alexander E. Patrakov

26.05.2015 19:03, Lennart Poettering wrote:

On Sat, 23.05.15 11:03, Ian Pilcher (arequip...@gmail.com) wrote:


Is there a simple way to make a service require that a specific network
interface/IP address be active?

I have a manually set up bridge and dnsmasq configuration for my VM
traffic, but dnsmasq is getting started before NetworkManager has
configured the bridge and failing because it cannot bind to the bridge's
IP address.


Well, for networkd, there's the systemd-networkd-wait-online tool that
allows you to wait until a specific interface is up. Maybe NM supports
something similar? Please ask NM folks for help.

Also, dnsmasq should probably use IP_FREEBIND or so (at least
optionally) so that it can work without requiring the interface to be
up.


dnsmasq supports --bind-dynamic option, which is based not on 
IP_FREEBIND, but on notifications about new or disappearing interfaces 
and addresses.


The real problem here is with non-C languages. E.g. node.js, Java, 
Python 2.7 and even Go still have absolutely no support for IP_FREEBIND.


--
Alexander E. Patrakov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-23 Thread Cristian Rodríguez
On Sat, May 23, 2015 at 1:03 PM, Ian Pilcher arequip...@gmail.com wrote:
 Is there a simple way to make a service require that a specific network
 interface/IP address be active?

You have to wait for the *link* to be active, not for the interface..

 I have a manually set up bridge and dnsmasq configuration for my VM
 traffic, but dnsmasq is getting started before NetworkManager has
 configured the bridge and failing because it cannot bind to the bridge's
 IP address.

This is problem has more than one face..

1) Enable the NetworkManager-wait-online service
2) order dnsmasq after the network-online target.

But this is all a workaround.. you could configure dnsmasq not to fail
to bind on interfaces that are not yet available at the point the
daemon is started.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-23 Thread Mantas Mikulėnas
On Sat, May 23, 2015 at 7:03 PM, Ian Pilcher arequip...@gmail.com wrote:

 Is there a simple way to make a service require that a specific network
 interface/IP address be active?

 I have a manually set up bridge and dnsmasq configuration for my VM
 traffic, but dnsmasq is getting started before NetworkManager has
 configured the bridge and failing because it cannot bind to the bridge's
 IP address.


dnsmasq has the bind-dynamic option for such situations.

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to wait for specific interface/IP?

2015-05-23 Thread Ian Pilcher

Is there a simple way to make a service require that a specific network
interface/IP address be active?

I have a manually set up bridge and dnsmasq configuration for my VM
traffic, but dnsmasq is getting started before NetworkManager has
configured the bridge and failing because it cannot bind to the bridge's
IP address.

TIA!

--

Ian Pilcher arequip...@gmail.com
 I grew up before Mark Zuckerberg invented friendship 


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel