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

Tony Seo tonyseo7 at gmail.com
Sun Dec 22 08:43:50 PST 2013


Hello.

As you recommend me to use "Accept=", I set this as "true".

But Client process waited for a few minute, it showed error message
"connection was refused".
In this case, The best case to execute the service unit is to set "Accept=
false".
But It will definitely present error message and be hanged.

systemd[1]: test_server.service start request repeated too quickly,
refusing to start.
systemd[1]: Failed to start test_server.service.systemd[1]:
test_server.service start request repeated too quickly, refusing to start.

Frankly speaking, I don't understand why service daemon is infinitely
spawned when I set the option "Accept= false".
And Why couldn't the client process connect to socket unit that I made by
setting "Accept= true".


Thanks.



2013/12/19 Tony Seo <tonyseo7 at gmail.com>

> Hello.
> I tried to execute a process by using socket activation.
> As it is referred at systemd manual, I made  "server" and "client" process
> by using "sd-daemon.h" and "sd-daemon.c".
> when I made those processes, I used UDS(Unix Domain Socket) to make
> communication between server and client.
> (I also made "/run/test_server" which executes like "/run/foobar.sk" in
> example of systemd manual for socket activation)
> http://0pointer.de/blog/projects/socket-activation.html
>
> And then, In order to make the process started, I made test_server.socket
> and test_server.service.
> those thing have contents like below:
>
> --------------------test_server.socket---------------------------
> [Socket]
> ListenStream=/run/test_server
>
> [Install]
> WantedBy=sockets.target
>
> ----------------------------------------------------------------------------
>
> --------------------test_server.service---------------------------
> [Service]
> Type=oneshot
> ExecStart=/bin/sh /usr/bin/kill-avn-process.sh
> StandardOutput=journal+console
> TTYPath=/dev/ttyTCC0
>
>
> [Install]
> WantedBy=multi-user.target
>
>
> ----------------------------------------------------------------------------
>
> As soon as I executed the client process, test_server.service worked
> rapidly but it seemed to run in infinite loop with changing it's PID and
> then, it showed  that error messages like:
> systemd[1]: test_server.service start request repeated too quickly,
> refusing to start.
> systemd[1]: Failed to start test_server.service.
>
> I already knew that a process executed by socket activation would be
> respawn.
> But, what the important thing is that I don't know how to control the
> number of respawn.
> And, why does systemd make the error about request timing.
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20131223/f0da0751/attachment-0001.html>


More information about the systemd-devel mailing list