summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-07-25 20:04:02 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-25 20:04:02 +0200
commit87d41d6244f1eaf441769f7f6216a606c52b8e89 (patch)
tree1201e0449eb8d3c06031c7ee95b5e6c98d4c9dda
parent2de0b9e913823d6e564ea82d80d014451c238f20 (diff)
downloadsystemd-87d41d6244f1eaf441769f7f6216a606c52b8e89.tar.gz
automount: don't cancel mount/umount request on reload/reexec (#3670)
All pending tokens are already serialized correctly and will be handled when the mount unit is done. Without this a 'daemon-reload' cancels all pending tokens. Any process waiting for the mount will continue with EHOSTDOWN. This can happen when the mount unit waits for it's dependencies, e.g. network, devices, fsck, etc.
-rw-r--r--src/core/automount.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 85803a9c4a..4e9891569c 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -98,9 +98,6 @@ static void unmount_autofs(Automount *a) {
if (a->pipe_fd < 0)
return;
- automount_send_ready(a, a->tokens, -EHOSTDOWN);
- automount_send_ready(a, a->expire_tokens, -EHOSTDOWN);
-
a->pipe_event_source = sd_event_source_unref(a->pipe_event_source);
a->pipe_fd = safe_close(a->pipe_fd);
@@ -109,6 +106,9 @@ static void unmount_autofs(Automount *a) {
if (a->where &&
(UNIT(a)->manager->exit_code != MANAGER_RELOAD &&
UNIT(a)->manager->exit_code != MANAGER_REEXECUTE)) {
+ automount_send_ready(a, a->tokens, -EHOSTDOWN);
+ automount_send_ready(a, a->expire_tokens, -EHOSTDOWN);
+
r = repeat_unmount(a->where, MNT_DETACH);
if (r < 0)
log_error_errno(r, "Failed to unmount: %m");