static bool service_can_reload_extensions(Service *s, bool warn);
+static void service_set_state(Service *s, ServiceState state);
+
static bool SERVICE_STATE_WITH_MAIN_PROCESS(ServiceState state) {
return IN_SET(state,
SERVICE_START, SERVICE_START_POST,
static int on_fd_store_io(sd_event_source *e, int fd, uint32_t revents, void *userdata) {
ServiceFDStore *fs = ASSERT_PTR(userdata);
+ Service *s = fs->service;
assert(e);
/* If we get either EPOLLHUP or EPOLLERR, it's time to remove this entry from the fd store */
- log_unit_debug(UNIT(fs->service),
+ log_unit_debug(UNIT(s),
"Received %s on stored fd %d (%s), closing.",
revents & EPOLLERR ? "EPOLLERR" : "EPOLLHUP",
fs->fd, strna(fs->fdname));
service_fd_store_unlink(fs);
+
+ if (s->state == SERVICE_DEAD_RESOURCES_PINNED && !s->fd_store)
+ service_set_state(s, SERVICE_DEAD);
+
return 0;
}