[systemd-devel] How to control socket activation when it run respawn infinitely.

Tony Seo tonyseo7 at gmail.com
Tue Dec 31 09:20:02 PST 2013


First of all, thank you for advice you said.
You are right, I am a novice on TCP/IP, so I had studied that for a few
days.
Now, I understand that UDS Protocol and the difference between
"Accept=true" and "Accept=false".
But What I really want to know is why the server process always waited in
the accept stage, when I executed client process for the first after system
boot.

As you know that socket activation makes a service related with socket unit
executed with connection of client process.
If the procedure for socket activation would run like that, the server
process executed for the first may not prepare the passive connection which
should be set beforehand because of client connection.
In my view, this waiting problem will be continue as far as the server
process is simultaneously executed with the client process.

what do you think about it?


Thanks.


2013/12/31 David Timothy Strauss <david at davidstrauss.net>

> On Mon, Dec 30, 2013 at 7:59 AM, Tony Seo <tonyseo7 at gmail.com> wrote:
> > That situation continued whether "Accept= true" or not in service unit.
>
> The reason I encouraged you to learn more about socket programming is
> because this Accept= option isn't some sort of optimization or nuanced
> thing you just try either way until you get it working. What layer
> handles accept() for connection-oriented protocols (systemd versus a
> daemon) is a fundamental aspect of socket programming. If you don't
> understand what Accept=true and Accept=false are supposed to do and
> just go about trying both, you still have more learning to do.
>
> Specifically, Accept=true means systemd handles the accept() calls and
> spawns an instance of the service for each connection. The socket
> passed into the service is one corresponding to a single client's
> connection. It is therefore appropriate to simply read from and write
> to fd=3. Trying to accept() from fd=3 will probably block forever if
> it works at all.
>
> Accept=false (the default) means systemd merely handles the listener
> socket. The service must make its own accept() calls to get sockets
> corresponding to individual client connections. The service should not
> directly read from and write from fd=3; it should do that with the
> socket instantiated by accept().
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140101/4622d6a3/attachment.html>


More information about the systemd-devel mailing list