chiark / gitweb /
getty: Start getty on 3270 terminals available on Linux on System z
[elogind.git] / src / core / swap.c
index 24c4611cbec3e1d7ce1b8204b20c3d023e319c9a..7004ede70e91daf7b54b30b3aed07b7493e9ffb5 100644 (file)
@@ -124,6 +124,8 @@ static void swap_init(Unit *u) {
         kill_context_init(&s->kill_context);
         cgroup_context_init(&s->cgroup_context);
 
+        unit_cgroup_context_init_defaults(u, &s->cgroup_context);
+
         s->parameters_proc_swaps.priority = s->parameters_fragment.priority = -1;
 
         s->control_command_id = _SWAP_EXEC_COMMAND_INVALID;
@@ -352,7 +354,7 @@ static int swap_load(Unit *u) {
                                 return r;
                 }
 
-                r = unit_exec_context_defaults(u, &s->exec_context);
+                r = unit_exec_context_patch_defaults(u, &s->exec_context);
                 if (r < 0)
                         return r;
         }
@@ -644,6 +646,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
                        UNIT(s)->manager->confirm_spawn,
                        UNIT(s)->manager->cgroup_supported,
                        UNIT(s)->cgroup_path,
+                       manager_get_runtime_prefix(UNIT(s)->manager),
                        UNIT(s)->id,
                        0,
                        NULL,
@@ -676,6 +679,8 @@ static void swap_enter_dead(Swap *s, SwapResult f) {
         exec_runtime_destroy(s->exec_runtime);
         s->exec_runtime = exec_runtime_unref(s->exec_runtime);
 
+        exec_context_destroy_runtime_directory(&s->exec_context, manager_get_runtime_prefix(UNIT(s)->manager));
+
         swap_set_state(s, s->result != SWAP_SUCCESS ? SWAP_FAILED : SWAP_DEAD);
 }