X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fautomount.c;h=0ae467cbd4f79a8fc005d78e05f0cbfd686c7e3c;hp=c557b6ebb212050066461b455d6abda0ccfeb75e;hb=0b1724894fb85aa1c07b2619e9269cfafd736956;hpb=a9e1f5ec36049dca715f83b2c6fc44a019e2da53 diff --git a/src/automount.c b/src/automount.c index c557b6ebb..0ae467cbd 100644 --- a/src/automount.c +++ b/src/automount.c @@ -154,7 +154,10 @@ static int automount_add_default_dependencies(Automount *a) { if (a->meta.manager->running_as == MANAGER_SYSTEM) { - if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTED_BY, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0) + if ((r = unit_add_dependency_by_name(UNIT(a), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0) + return r; + + if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0) return r; } @@ -241,7 +244,7 @@ static void automount_set_state(Automount *a, AutomountState state) { automount_state_to_string(old_state), automount_state_to_string(state)); - unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state]); + unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state], true); } static int automount_coldplug(Unit *u) { @@ -760,7 +763,16 @@ static void automount_fd_event(Unit *u, int fd, uint32_t events, Watch *w) { switch (packet.hdr.type) { case autofs_ptype_missing_direct: - log_debug("Got direct mount request for %s", packet.v5_packet.name); + + if (packet.v5_packet.pid > 0) { + char *p = NULL; + + get_process_name(packet.v5_packet.pid, &p); + log_debug("Got direct mount request for %s, triggered by %lu (%s)", packet.v5_packet.name, (unsigned long) packet.v5_packet.pid, strna(p)); + free(p); + + } else + log_debug("Got direct mount request for %s", packet.v5_packet.name); if (!a->tokens) if (!(a->tokens = set_new(trivial_hash_func, trivial_compare_func))) {