X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fautomount.c;h=e13259b388c0f6a11cd34904ad928adfa35a598b;hb=ec8927ca5940e809f0b72f530582c76f1db4f065;hp=11c217beb9f10abfbf90bf82f0cfe081b3c2f528;hpb=5430f7f2bc7330f3088b894166bf3524a067e3d8;p=elogind.git diff --git a/src/core/automount.c b/src/core/automount.c index 11c217beb..e13259b38 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -39,6 +39,7 @@ #include "special.h" #include "label.h" #include "mkdir.h" +#include "path-util.h" static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = { [AUTOMOUNT_DEAD] = UNIT_INACTIVE, @@ -155,14 +156,12 @@ static int automount_add_default_dependencies(Automount *a) { assert(a); - if (UNIT(a)->manager->running_as == MANAGER_SYSTEM) { - - if ((r = unit_add_dependency_by_name(UNIT(a), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0) - return r; + if (UNIT(a)->manager->running_as != MANAGER_SYSTEM) + return 0; - if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0) - return r; - } + r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true); + if (r < 0) + return r; return 0; } @@ -884,5 +883,17 @@ const UnitVTable automount_vtable = { .bus_message_handler = bus_automount_message_handler, .bus_invalidating_properties = bus_automount_invalidating_properties, - .shutdown = automount_shutdown + .shutdown = automount_shutdown, + + .status_message_formats = { + .finished_start_job = { + [JOB_DONE] = "Set up automount %s.", + [JOB_FAILED] = "Failed to set up automount %s.", + [JOB_DEPENDENCY] = "Dependency failed for %s.", + }, + .finished_stop_job = { + [JOB_DONE] = "Unset automount %s.", + [JOB_FAILED] = "Failed to unset automount %s.", + }, + }, };