From 9b88bb5023dfa3cea406c14fdaa3d8e3e320907a Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 28 Oct 2019 18:41:59 +0100 Subject: [PATCH] swap: do not make swap units wanted by its device unit anymore It was done for mount units already (see commit 142b8142d7bb84f07). For the same reasons and for consistency we should also stop activating automagically swaps when their device is hot-plugged. --- src/core/swap.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/swap.c b/src/core/swap.c index 726bda2f37..22827a296c 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -197,12 +197,11 @@ static int swap_add_device_dependencies(Swap *s) { return 0; if (is_device_path(s->what)) - return unit_add_node_dependency(UNIT(s), s->what, MANAGER_IS_SYSTEM(UNIT(s)->manager), UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE); - else - /* File based swap devices need to be ordered after - * systemd-remount-fs.service, since they might need a - * writable file system. */ - return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, true, UNIT_DEPENDENCY_FILE); + return unit_add_node_dependency(UNIT(s), s->what, false, UNIT_BINDS_TO, UNIT_DEPENDENCY_FILE); + + /* File based swap devices need to be ordered after systemd-remount-fs.service, + * since they might need a writable file system. */ + return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, true, UNIT_DEPENDENCY_FILE); } static int swap_add_default_dependencies(Swap *s) { -- 2.25.1