The road forward for systemd
The road forward for systemd
Posted May 26, 2010 19:12 UTC (Wed) by drag (guest, #31333)In reply to: The road forward for systemd by Cyberax
Parent article: The road forward for systemd
If my understanding is correct:
Presumably when a application requests something from BIND; it will get launched to serve that request.
Sooo... it would go something like this:
1 Application requests name resolution
2 Request goes through the nsswitch stuff. The nsswitch configuration indicates:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
3. So the look up checks your hosts files, tries mdns4_minimal (which should trigger Avahi to start up) then finally ties the 'dns' method.
4. The /etc/resolv.conf file is checked. The resolv.conf has, as it's first entry:
nameserver 127.0.0.1
5a. The code then connects to UDP or TCP port 53 on localhost.
5b. The Systemd configuration method would have bind service conifigured and the systemd stuff will be listenning on port 53 in a inetd-like fashion.
6. Systemd responds to request on localhost port 53 and launches Bind.
Soooo.... To answer your question of:
>How do I mark this dependency?
You configure /etc/resolv.conf to have localhost as a nameserver.
Posted May 26, 2010 22:37 UTC (Wed)
by mezcalero (subscriber, #45103)
[Link] (3 responses)
Posted May 26, 2010 22:56 UTC (Wed)
by cesarb (subscriber, #6266)
[Link] (2 responses)
With systemd, the listening socket would become available very quickly in the computer with the resolver (limited mostly by the BIOS delay); that is, even between separate machines, it could help.
It would be even cooler if it were possible to have service dependencies across machines (so for instance machine A would delay loading a service until a listening socket in machine B becomes available). This would end the problem of having to figure out which machine you have to boot first when the power went out on your >300-day uptime servers.
Posted May 26, 2010 23:54 UTC (Wed)
by foom (subscriber, #14868)
[Link] (1 responses)
Posted May 27, 2010 19:50 UTC (Thu)
by mgedmin (subscriber, #34497)
[Link]
Posted May 27, 2010 10:32 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Also, what if I want to listen only on a few interfaces (LAN interface and localhost) - are we going to completely replicate inetd (which I have gladly exterminated from my systems) there?
Posted May 27, 2010 15:27 UTC (Thu)
by drag (guest, #31333)
[Link]
Thats the idea, I suppose.
> (I don't have Avahi, BTW)?
You should. It kicks ass. I've long stopped given a shit about static IP configurations and mucking around with DNS on my network because of it. Services like DAAP are cool.
> Can you point out where the blog post says something about _network_ services? Can it even be done correctly?
OK:
So AF_INET == Network Socket for IPv4
> Also, what if I want to listen only on a few interfaces (LAN interface and localhost) -
No clue. Apparently for things to work optimally the services need to be patched so that they can take care of those sort of details themselves.
Probably with 'dumb' non-systemd optimized services you'll have to edit Systemd configs a little bit.
> are we going to completely replicate inetd (which I have gladly exterminated from my systems) there?
Sounds like it. Hope so. I like things to be simple.
Posted May 31, 2010 16:56 UTC (Mon)
by mezcalero (subscriber, #45103)
[Link]
And, as mentioned we create automatic dependencies between sockets and network interface devices if you for example configure a socket to bind to one particular interface only. That for example is another thing inetd cannot do for you, because it handles only sockets and nothing else. We track and control the entire system state, and hence can easily cover this, too.
The road forward for systemd
The road forward for systemd
The road forward for systemd
The road forward for systemd
The road forward for systemd
The road forward for systemd
> 2. socket: this unit encapsulates a socket in the file-system or on the Internet. We currently support AF_INET, AF_INET6, AF_UNIX sockets of the types stream, datagram, and sequential packet. We also support classic FIFOs as transport. Each socket unit has a matching service unit, that is started if the first connection comes in on the socket or FIFO. Example nscd.socket starts nscd.service on an incoming connection.
So AF_INET6 == Network Socket for IPv6
The road forward for systemd