summaryrefslogtreecommitdiff
path: root/src/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/swap.c')
-rw-r--r--src/swap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/swap.c b/src/swap.c
index 69ccd3db6c..0beb9212ea 100644
--- a/src/swap.c
+++ b/src/swap.c
@@ -113,7 +113,10 @@ static int swap_add_target_links(Swap *s) {
if ((r = manager_load_unit(s->meta.manager, SPECIAL_SWAP_TARGET, NULL, NULL, &tu)) < 0)
return r;
- if (!p->noauto && (p->handle || s->meta.manager->swap_auto) && s->meta.manager->running_as == MANAGER_SYSTEM)
+ if (!p->noauto &&
+ (p->handle || s->meta.manager->swap_auto) &&
+ !s->from_fragment &&
+ s->meta.manager->running_as == MANAGER_SYSTEM)
if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(s), true)) < 0)
return r;