Posted May 27, 2010 18:27 UTC (Thu) by drag (subscriber, #31333)
[Link]
> For example, what systemd is going to do if network interface required for the daemon does not go up? Or only one of two interfaces goes up?
Not sure.
Most network services that want to listen on multiple interfaces will just listen to 0.0.0.0 which will cause them to listen to all network interfaces regardless of the time they come up or not. In that case the service will remain dormant until somebody on any network tries to use it.
For network services that I've used that depend on different ports being open for different purposes the daemon itself just listenned on all interfaces and then only responded appropriately based on it's own internal configuration.
For example: DNSMASQ.
Dnsmasq (just so you don't have to look it up if you never used it) is a clever little daemon used to cache DNS requests and can perform DHCP services if configured. I've used it extensively for building network routers and in doing virtual machine host configurations. It's also used in things like OpenWRT for small soho routers. Very nice little application that allows me to eliminate a number of difficult-to-configure services and can read from yoru hosts file to make it simple to make contained DNS resolved network names for a small/medium sized network.
Well Dnsmasq depends on being able to use the DNS ports and DHCP ports on the internal network. Then it also needs to have the ability to do DNS requests to a external network.
Also it's common to have many multiple network ports on a router, so you can configure it to provide DHCP services to some networks, but not on others.
Now you can hard-code it to use only certain network interfaces or ip addresses, but the recommended configuration just has it listenning to DNS/DHCP requests on all networks simultaniously and it will choose to respond to it based netmasks and that sort of thing. That way you don't have to care about it... it takes care of the policies on it's own.
---------------------------------------
Otherwise what I use for services like that that can't handle things intellegently I'll use If/up, if/down network initialization scripts and/or Network-Manager-Dispatcher (which behaves very similar and uses a similar structure to ifup/ifdown scripts)
Needless to say that all of this would be a advanced system-specific configuration and is a nitch need. For a general purpose thing like Systemd it may not be appropriate for it to address this needs.
But if it could then that would be terrific, of course.
The road forward for systemd
Posted May 27, 2010 19:34 UTC (Thu) by hppnq (guest, #14462)
[Link]
There has been a solution [1] for this for a while: ip_nonlocal_bind enables binding to a specific address that is (temporarily) unavailable. Of course, it has nothing to do with systemd, but neither has this problem. ;-)
[1] YMMV.
The road forward for systemd
Posted May 31, 2010 16:52 UTC (Mon) by mezcalero (subscriber, #45103)
[Link]
There's already a (limited) automatic dependency system in systemd for handling sockets and network devices. For example, if you bind a socket to a particular interface (such as eth0) we add an automatic dependency from the .socket unit to the .device unit of the network interface.