chiark / gitweb /
core: move ManagerRunningAs to shared
[elogind.git] / src / core / automount.c
index 91162c2a58456d5c38d386becd96da0e84ff6583..11b6a6a45a064f452f088f8c78bedb1ee8de205f 100644 (file)
@@ -156,7 +156,7 @@ static int automount_add_default_dependencies(Automount *a) {
 
         assert(a);
 
-        if (UNIT(a)->manager->running_as != MANAGER_SYSTEM)
+        if (UNIT(a)->manager->running_as != SYSTEMD_SYSTEM)
                 return 0;
 
         r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true);
@@ -501,6 +501,9 @@ static void automount_enter_waiting(Automount *a) {
         /* We knowingly ignore the results of this call */
         mkdir_p_label(a->where, 0555);
 
+        if (dir_is_empty(a->where) <= 0)
+                log_notice("%s: Directory %s to mount over is not empty, ignoring. (To see the over-mounted files, please manually mount the underlying file system to a secondary location.)", a->meta.id, a->where);
+
         if (pipe2(p, O_NONBLOCK|O_CLOEXEC) < 0) {
                 r = -errno;
                 goto fail;
@@ -780,11 +783,12 @@ static void automount_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
                         char *p = NULL;
 
                         get_process_comm(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));
+                        log_debug("Got direct mount request on %s, triggered by %lu (%s)",
+                                  a->where, (unsigned long) packet.v5_packet.pid, strna(p));
                         free(p);
 
                 } else
-                        log_debug("Got direct mount request for %s", packet.v5_packet.name);
+                        log_debug("Got direct mount request on %s", a->where);
 
                 if (!a->tokens)
                         if (!(a->tokens = set_new(trivial_hash_func, trivial_compare_func))) {