socket_free_ports(s);
- exec_context_done(&s->exec_context, manager_is_reloading_or_reexecuting(u->manager));
- cgroup_context_init(&s->cgroup_context);
-
+ cgroup_context_done(&s->cgroup_context);
+ exec_context_done(&s->exec_context);
+ s->exec_runtime = exec_runtime_unref(s->exec_runtime);
exec_command_free_array(s->exec_command, _SOCKET_EXEC_COMMAND_MAX);
s->control_command = NULL;
unit_realize_cgroup(UNIT(s));
+ r = unit_setup_exec_runtime(UNIT(s));
+ if (r < 0)
+ goto fail;
+
r = socket_arm_timer(s);
if (r < 0)
goto fail;
UNIT(s)->cgroup_path,
UNIT(s)->id,
NULL,
+ s->exec_runtime,
&pid);
strv_free(argv);
if (f != SOCKET_SUCCESS)
s->result = f;
- exec_context_tmp_dirs_done(&s->exec_context);
+ exec_runtime_destroy(s->exec_runtime);
+ s->exec_runtime = exec_runtime_unref(s->exec_runtime);
+
socket_set_state(s, s->result != SOCKET_SUCCESS ? SOCKET_FAILED : SOCKET_DEAD);
}
if (p->fd < 0)
continue;
- if ((copy = fdset_put_dup(fds, p->fd)) < 0)
+ copy = fdset_put_dup(fds, p->fd);
+ if (copy < 0)
return copy;
if (p->type == SOCKET_SOCKET) {
- char *t;
+ _cleanup_free_ char *t = NULL;
r = socket_address_print(&p->address, &t);
if (r < 0)
unit_serialize_item_format(u, f, "netlink", "%i %s", copy, t);
else
unit_serialize_item_format(u, f, "socket", "%i %i %s", copy, p->address.type, t);
- free(t);
+
} else if (p->type == SOCKET_SPECIAL)
unit_serialize_item_format(u, f, "special", "%i %s", copy, p->path);
else if (p->type == SOCKET_MQUEUE)
}
}
- exec_context_serialize(&s->exec_context, UNIT(s), f);
-
return 0;
}
p->fd = fdset_remove(fds, fd);
}
}
- } else if (streq(key, "tmp-dir")) {
- char *t;
-
- t = strdup(value);
- if (!t)
- return log_oom();
-
- s->exec_context.tmp_dir = t;
- } else if (streq(key, "var-tmp-dir")) {
- char *t;
-
- t = strdup(value);
- if (!t)
- return log_oom();
-
- s->exec_context.var_tmp_dir = t;
} else
log_debug_unit(UNIT(s)->id,
"Unknown serialization key '%s'", key);
.exec_context_offset = offsetof(Socket, exec_context),
.cgroup_context_offset = offsetof(Socket, cgroup_context),
.kill_context_offset = offsetof(Socket, kill_context),
+ .exec_runtime_offset = offsetof(Socket, exec_runtime),
.sections =
"Unit\0"