diff --git a/src/core/swap.c b/src/core/swap.c index cf33ab602ef..13e12ad67a1 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