that's not really an answer to your question but...
have you looked at systemd-socket-proxyd ? it's a simple program that is
meant to be started by a socket and will redirect all traffic to another
Properly used it allows a traditional network daemon to be started on
demand. I won't go in the details, it's pretty well explained in the man
Depending on why you are converting your software, it could be something
interesting to look at...
Post by Mantas MikulÄnas Post by Liam Kelly
How does Systemd communicate to socket activated application that the
connection has been closed? How can I modify my application to detect this
event if it cannot be configured to be closed automatically?
We are trying to add network support to legacy code using Systemd sockets.
Using the 0pointer tutorials, we were able to configure a listening TCP
port and launch an instance of the application when a TCP connection came
in. The problem is that when the connection is closed, the service is still
The systemct list-units and netstat -tuapn outputs are what you would
expect when the connection is established
active running My App
tcp 0 0 192.168.0.75:10001 192.168.210.102:19983
However, once the client closes the connection, the socket is closed and
It is no different from any other type of networked service. Whether you
opened the socket yourself, or received it from a superserver, makes no
For example, if your program uses poll(), the kernel reports POLLHUP on a
closed socket. If the program uses read() or recv(), 0 bytes indicates that
the socket is closed. If the program uses simple stdio (inetd style), it's
enough to check for EOF on reads from stdin.
systemd-devel mailing list
20 rue des Jardins
Responsable de l'expertise Smile-ECS
email ***@smile.fr <mailto:***@smile.fr>
Twitter <https://twitter.com/GroupeSmile> Facebook
DÃ©couvrez lâunivers Smile, rendez-vous sur smile.eu
eco Pour la planÃšte, n'imprimez ce mail que si c'est nÃ©cessaire