s->exec_context.std_output = u->manager->default_std_output;
s->exec_context.std_error = u->manager->default_std_error;
kill_context_init(&s->kill_context);
+ cgroup_context_init(&s->cgroup_context);
s->parameters_proc_swaps.priority = s->parameters_fragment.priority = -1;
exec_command_done_array(s->exec_command, _SWAP_EXEC_COMMAND_MAX);
s->control_command = NULL;
+ cgroup_context_done(&s->cgroup_context);
+
swap_unwatch_control_pid(s);
unit_unwatch_timer(u, &s->timer_watch);
if (r < 0)
return r;
- r = unit_add_default_cgroups(u);
- if (r < 0)
- return r;
-
if (UNIT(s)->default_dependencies) {
r = swap_add_default_dependencies(s);
if (r < 0)
assert(c);
assert(_pid);
+ unit_realize_cgroup(UNIT(s));
+
r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
if (r < 0)
goto fail;
true,
true,
UNIT(s)->manager->confirm_spawn,
- UNIT(s)->cgroup_bondings,
- UNIT(s)->cgroup_attributes,
- NULL,
+ UNIT(s)->cgroup_mask,
+ UNIT(s)->cgroup_path,
UNIT(s)->id,
NULL,
&pid);
"Swap\0"
"Install\0",
+ .private_section = "Swap",
.exec_context_offset = offsetof(Swap, exec_context),
- .exec_section = "Swap",
+ .cgroup_context_offset = offsetof(Swap, cgroup_context),
.no_alias = true,
.no_instances = true,
.bus_interface = "org.freedesktop.systemd1.Swap",
.bus_message_handler = bus_swap_message_handler,
.bus_invalidating_properties = bus_swap_invalidating_properties,
+ .bus_set_property = bus_swap_set_property,
+ .bus_commit_properties = bus_swap_commit_properties,
.following = swap_following,
.following_set = swap_following_set,