X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmount.c;h=36caae3c812d7ee6299a743072449be926872b0b;hp=6b38741c35407a51dc0a1d8dd69f7d486b7d66c3;hb=73c33e7f225f81e6066386fba997e8ea2ba361b3;hpb=2c966c038dc32ef39baa176371395cde4e541d01 diff --git a/src/mount.c b/src/mount.c index 6b38741c3..36caae3c8 100644 --- a/src/mount.c +++ b/src/mount.c @@ -60,15 +60,15 @@ static void mount_init(Unit *u) { assert(u->meta.load_state == UNIT_STUB); m->timeout_usec = DEFAULT_TIMEOUT_USEC; - exec_context_init(&m->exec_context); - m->directory_mode = 0755; + exec_context_init(&m->exec_context); + /* We need to make sure that /bin/mount is always called in * the same process group as us, so that the autofs kernel * side doesn't send us another mount request while we are * already trying to comply its last one. */ - m->exec_context.no_setsid = true; + m->exec_context.same_pgrp = true; m->timer_watch.type = WATCH_INVALID; @@ -253,7 +253,7 @@ static int mount_add_target_links(Mount *m) { else target = SPECIAL_LOCAL_FS_TARGET; - if ((r = manager_load_unit(m->meta.manager, target, NULL, &tu)) < 0) + if ((r = manager_load_unit(m->meta.manager, target, NULL, NULL, &tu)) < 0) return r; if (automount && m->meta.manager->running_as == MANAGER_SYSTEM) { @@ -367,6 +367,12 @@ static int mount_load(Unit *u) { if ((r = unit_add_default_cgroup(u)) < 0) return r; + + if (m->meta.default_dependencies && + m->meta.manager->running_as == MANAGER_SYSTEM && + !path_equal(m->where, "/")) + if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0) + return r; } return mount_verify(m); @@ -534,6 +540,7 @@ static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) { m->meta.manager->environment, true, true, + true, m->meta.manager->confirm_spawn, m->meta.cgroup_bondings, &pid)) < 0) @@ -936,7 +943,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { m->failure = m->failure || !success; if (m->control_command) { - exec_status_fill(&m->control_command->exec_status, pid, code, status); + exec_status_exit(&m->control_command->exec_status, pid, code, status); m->control_command = NULL; m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID; } @@ -1548,6 +1555,7 @@ const UnitVTable mount_vtable = { .no_alias = true, .no_instances = true, .no_isolate = true, + .show_status = true, .init = mount_init, .load = mount_load,