Blame SOURCES/0029-unit-use-weaker-dependencies-between-mount-and-devic.patch
|
|
17b0f1 |
From 1c0e8e9ce84cd74a20a60b98ab3a39d75d05b45f Mon Sep 17 00:00:00 2001
|
|
|
17b0f1 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
17b0f1 |
Date: Wed, 25 Feb 2015 22:05:14 +0100
|
|
|
17b0f1 |
Subject: [PATCH] unit: use weaker dependencies between mount and device units
|
|
|
17b0f1 |
in --user mode
|
|
|
17b0f1 |
|
|
|
17b0f1 |
When running in user mode unmounting of mount units when a device
|
|
|
17b0f1 |
vanishes is unlikely to work, and even if it would work is already done
|
|
|
17b0f1 |
by PID 1 anyway. HEnce, when creating implicit dependencies between
|
|
|
17b0f1 |
mount units and their backing devices, created a Wants= type dependency
|
|
|
17b0f1 |
in --user mode, but leave a BindsTo= dependency in --system mode.
|
|
|
17b0f1 |
|
|
|
17b0f1 |
(cherry picked from commit 5bd4b173605142c7be493aa4d958ebaef21f421d)
|
|
|
17b0f1 |
---
|
|
|
17b0f1 |
src/core/unit.c | 2 +-
|
|
|
17b0f1 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
17b0f1 |
|
|
|
17b0f1 |
diff --git a/src/core/unit.c b/src/core/unit.c
|
|
|
17b0f1 |
index ee8e607c27..9f1e55e2f1 100644
|
|
|
17b0f1 |
--- a/src/core/unit.c
|
|
|
17b0f1 |
+++ b/src/core/unit.c
|
|
|
17b0f1 |
@@ -2845,7 +2845,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
|
|
|
17b0f1 |
if (r < 0)
|
|
|
17b0f1 |
return r;
|
|
|
17b0f1 |
|
|
|
17b0f1 |
- r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true);
|
|
|
17b0f1 |
+ r = unit_add_two_dependencies(u, UNIT_AFTER, u->manager->running_as == SYSTEMD_SYSTEM ? UNIT_BINDS_TO : UNIT_WANTS, device, true);
|
|
|
17b0f1 |
if (r < 0)
|
|
|
17b0f1 |
return r;
|
|
|
17b0f1 |
|