X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fswap.c;h=0a1cc80936837868a4140141b16d0e7a7ccb2e31;hb=25fa306ed58b0b7fe30ca9be37c66a7b3b2de70e;hp=cf33ab602ef29010bc8a10b39b6eac102196930a;hpb=ddb7d6b9420275fb4451185cd63bd0cbb74ad8e5;p=elogind.git diff --git a/src/core/swap.c b/src/core/swap.c index cf33ab602..0a1cc8093 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -196,6 +196,9 @@ static int swap_add_device_links(Swap *s) { if (!s->what) return 0; + if (!s->from_fragment) + return 0; + if (is_device_path(s->what)) return unit_add_node_link(UNIT(s), s->what, UNIT(s)->manager->running_as == SYSTEMD_SYSTEM); else @@ -624,6 +627,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) { exec_params.confirm_spawn = UNIT(s)->manager->confirm_spawn; exec_params.cgroup_supported = UNIT(s)->manager->cgroup_supported; exec_params.cgroup_path = UNIT(s)->cgroup_path; + exec_params.cgroup_delegate = s->cgroup_context.delegate; exec_params.runtime_prefix = manager_get_runtime_prefix(UNIT(s)->manager); exec_params.unit_id = UNIT(s)->id; @@ -684,7 +688,8 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) { r = unit_kill_context( UNIT(s), &s->kill_context, - state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM, + (state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM) ? + KILL_KILL : KILL_TERMINATE, -1, s->control_pid, false);