[systemd-devel] Using Systemd "FD Store" facilitiy

Pathangi Janardhanan path.jana at gmail.com
Mon Jan 11 22:50:07 PST 2016


Hi,

 I had previously sent a mail on this but got no response, so wanted to
check again.

 I am trying to use systemd as a way to store and restore the FDs used by a
service, so that the service can provide continuation of service during an
upgrade. for the purpose of trying it out, I am using a simple TCP echo
server as my service

 The issues I see are :

1. I store the fds using sd_pid_notify_with_fds, and then do a systemctl
restart of the service. Then I use sd_listen_fds and get all the fds back
and the service continues without disturbance. But the problem is

a.  systemd continues to hold all these fds, so now if my service is done
with the fd and closes the connection, this is not getting through to the
client, as systemd continues to have this fd

b. Even if the client closes the connection, my service gets it and closes
the connection but systemd still holds on to this fd.

 so in essence once I store the fd with systemd using
sd_pid_notify_with_fds, they do not go away untill I do a systemctl stop of
my service

This is making it difficult to use this service in the intended way. It
would be nice
if on sd_listen_fds, the sytemd passes all fds back to the service and
internally cleared its state, so that only the service has the fds. (this
is ofcourse only for
those fds that the service had previously send in sd_pid_notify_with_fds,
the other fds that the service gets as part of socket activation would
continue to be held in systemd also.)

Let me know if this sounds correct, or am I mis-understanding the way this
service is to be used.

Thanks
Jana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20160112/4f16e27a/attachment.html>


More information about the systemd-devel mailing list