summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorChris Leech <cleech@redhat.com>2014-11-23 20:33:39 -0800
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-11-28 14:30:50 -0500
commitbefb6d54948480f836d53d633bef27e3505818c1 (patch)
treeaf77c29722d934c06ac261d2e74472058bc08d0c /src/core/manager.c
parent8d3ae2bd4c9bf9fc2e57f7b3776325a1c750ca30 (diff)
mount: monitor for utab changes with inotify
Parsing the mount table with libmount races against the mount command, which will handle the actual mounting before updating utab. This means the poll event on /proc/self/mountinfo can kick of a reparse in systemd before the utab information is available. This change adds in an additional event source using inotify to watch for changes to utab. It only watches for IN_MOVED_TO events, matching libmount behavior of always overwriting this file using rename(2). This does add a second pass through the mount table parsing when utab is updated.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 3e1728f925..7b2550065d 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -540,7 +540,7 @@ int manager_new(SystemdRunningAs running_as, bool test_run, Manager **_m) {
m->idle_pipe[0] = m->idle_pipe[1] = m->idle_pipe[2] = m->idle_pipe[3] = -1;
- m->pin_cgroupfs_fd = m->notify_fd = m->signal_fd = m->time_change_fd = m->dev_autofs_fd = m->private_listen_fd = m->kdbus_fd = -1;
+ m->pin_cgroupfs_fd = m->notify_fd = m->signal_fd = m->time_change_fd = m->dev_autofs_fd = m->private_listen_fd = m->kdbus_fd = m->utab_inotify_fd = -1;
m->current_job_id = 1; /* start as id #1, so that we can leave #0 around as "null-like" value */
m->ask_password_inotify_fd = -1;