]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
service: rework how we release resources
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Mar 2023 20:06:39 +0000 (22:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 13 Apr 2023 04:44:27 +0000 (06:44 +0200)
commitc25fac9a17b95271bb6f8d967d33c5a9aa9e4bc9
treea0f8aa27f6552213324b6b80359dbc9e6817e51c
parent6ac62d61db737b01ad3776a7688d8a4c57b3f7d9
service: rework how we release resources

Let's normalize how we release service resources, i.e. the three types
of fds we maintain for each service:

1. the fdstore
2. the socket fd for per-connection socket activated services
3. stdin/stdout/stderr

The generic service_release_resources() hook now calls into
service_release_fd_store() + service_close_socket_fd()
service_release_stdio_fd() one after the other, releasing them all for
the generic "release_resources" infra of the unit lifecycle.

We do no longer close the socket fd from service_set_state(), moving
this exclusively into service_release_resources(), so that all fds are
closed the same way.
src/core/service.c