core: when restarting services, don't close fds
We would close all the stored fds in service_release_resources(), which of course broke the whole concept of storing fds over service restart. Fixes #4408.
This commit is contained in:
+4
-2
@@ -302,6 +302,7 @@ int unit_set_description(Unit *u, const char *description) {
|
||||
|
||||
bool unit_check_gc(Unit *u) {
|
||||
UnitActiveState state;
|
||||
bool inactive;
|
||||
assert(u);
|
||||
|
||||
if (u->job)
|
||||
@@ -311,16 +312,17 @@ bool unit_check_gc(Unit *u) {
|
||||
return true;
|
||||
|
||||
state = unit_active_state(u);
|
||||
inactive = state == UNIT_INACTIVE;
|
||||
|
||||
/* If the unit is inactive and failed and no job is queued for
|
||||
* it, then release its runtime resources */
|
||||
if (UNIT_IS_INACTIVE_OR_FAILED(state) &&
|
||||
UNIT_VTABLE(u)->release_resources)
|
||||
UNIT_VTABLE(u)->release_resources(u);
|
||||
UNIT_VTABLE(u)->release_resources(u, inactive);
|
||||
|
||||
/* But we keep the unit object around for longer when it is
|
||||
* referenced or configured to not be gc'ed */
|
||||
if (state != UNIT_INACTIVE)
|
||||
if (!inactive)
|
||||
return true;
|
||||
|
||||
if (u->no_gc)
|
||||
|
||||
Reference in New Issue
Block a user