chiark / gitweb /
sd-event: implicitly set signal event source's descriptions to the signal name
[elogind.git] / src / core / swap.c
index cf33ab602ef29010bc8a10b39b6eac102196930a..1add722bf13db58cf4869f63380cebd90c493bf8 100644 (file)
@@ -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
@@ -684,7 +687,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);