diff --git a/CHANGELOG b/CHANGELOG index 866ae0a..24dbe19 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ - remove SIGCHLD handler. - alter expire locking of multi-mounts to lock sub-tree instead of entire tree. +- review verbose message feedback and update. 13/7/2006 autofs-5.0.1 rc1 -------------------------- diff --git a/daemon/automount.c b/daemon/automount.c index 5fba783..5e2b4c3 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -444,7 +444,7 @@ int umount_multi(struct autofs_point *ap * it already to ensure it's ok to remove any offset triggers */ if (me != me->multi) { - warn(ap->logopt, "unmounting dir = %s", path); + msg("unmounting dir = %s", path); if (umount_ent(ap, path)) { warn(ap->logopt, "could not umount dir %s", path); diff --git a/daemon/direct.c b/daemon/direct.c index 5a528fc..4b6162b 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -199,10 +199,10 @@ int do_umount_autofs_direct(struct autof force_umount: if (rv != 0) { - msg("forcing umount of %s", me->key); + msg("forcing umount of direct mount %s", me->key); rv = umount2(me->key, MNT_DETACH); } else - msg("umounted %s", me->key); + msg("umounted direct mount %s", me->key); if (!rv && me->dir_created) { if (rmdir(me->key) == -1) { @@ -372,6 +372,8 @@ int do_mount_autofs_direct(struct autofs goto out_err; } + msg("mounted autofs direct mount on %s", me->key); + /* Root directory for ioctl()'s */ ioctlfd = open(me->key, O_RDONLY); if (ioctlfd < 0) { @@ -583,10 +585,10 @@ int umount_autofs_offset(struct autofs_p force_umount: if (rv != 0) { - msg("forcing umount of %s", me->key); + msg("forcing umount of offset mount %s", me->key); rv = umount2(me->key, MNT_DETACH); } else - msg("umounted offset %s", me->key); + msg("umounted offset mount %s", me->key); return rv; } @@ -741,6 +743,7 @@ static int expire_direct(int ioctlfd, co if (errno != EAGAIN) return 0; } + nanosleep(&tm, NULL); } @@ -817,8 +820,7 @@ void *expire_proc_direct(void *arg) ret = expire_direct(ioctlfd, next->path, now, ap->logopt); if (!ret) { - debug(ap->logopt, - "failed to expire mount %s", next->path); + msg("mount apparently busy %s", next->path); ea->status++; } } diff --git a/daemon/indirect.c b/daemon/indirect.c index 766ec08..8748413 100644 --- a/daemon/indirect.c +++ b/daemon/indirect.c @@ -171,6 +171,8 @@ static int do_mount_autofs_indirect(stru options = NULL; + msg("mounted autofs indirect mount on %s", ap->path); + /* Root directory for ioctl()'s */ ap->ioctlfd = open(ap->path, O_RDONLY); if (ap->ioctlfd < 0) { @@ -353,10 +355,11 @@ int umount_autofs_indirect(struct autofs force_umount: if (rv != 0) { - warn(ap->logopt, "forcing umount of %s", ap->path); + warn(ap->logopt, + "forcing umount of indirect mount %s", ap->path); rv = umount2(ap->path, MNT_DETACH); } else { - msg("umounted %s", ap->path); + msg("umounted indirect mount %s", ap->path); if (ap->submount) rm_unwanted(ap->path, 1, ap->dev); } @@ -470,8 +473,7 @@ void *expire_proc_indirect(void *arg) ret = expire_indirect(ioctlfd, next->path, now, retries, ap->logopt); if (!ret) { - debug(ap->logopt, - "failed to expire mount %s", next->path); + msg("mount apparently busy %s", next->path); ea->status++; } } diff --git a/lib/parse_subs.c b/lib/parse_subs.c index a24e6da..77651cf 100644 --- a/lib/parse_subs.c +++ b/lib/parse_subs.c @@ -463,6 +463,7 @@ cont: * the offset triggers back. */ if (is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) { + msg("unmounting dir = %s", root); if (umount_ent(ap, root)) { if (!mount_multi_triggers(ap, root, me, "/")) warn(ap->logopt, diff --git a/modules/cyrus-sasl.c b/modules/cyrus-sasl.c index 6058548..8821f84 100644 --- a/modules/cyrus-sasl.c +++ b/modules/cyrus-sasl.c @@ -196,9 +196,8 @@ get_server_SASL_mechanisms(LDAP *ld) ldap_msgfree(results); if (mechanisms == NULL) { /* Well, that was a waste of time. */ - info(LOGOPT_ANY, - "No SASL authentication mechanisms are supported" - " by the LDAP server.\n"); + msg("No SASL authentication mechanisms are supported" + " by the LDAP server.\n"); return NULL; } diff --git a/modules/lookup_file.c b/modules/lookup_file.c index 6485ef2..9a9f498 100644 --- a/modules/lookup_file.c +++ b/modules/lookup_file.c @@ -75,17 +75,15 @@ int lookup_init(const char *mapfmt, int ctxt->mapname = argv[0]; if (ctxt->mapname[0] != '/') { - debug(LOGOPT_NONE, - MODPREFIX "file map %s is not an absolute pathname", - ctxt->mapname); + msg(MODPREFIX "file map %s is not an absolute pathname", + ctxt->mapname); free(ctxt); return 1; } if (access(ctxt->mapname, R_OK)) { - warn(LOGOPT_ANY, - MODPREFIX "file map %s missing or not readable", - ctxt->mapname); + msg(MODPREFIX "file map %s missing or not readable", + ctxt->mapname); free(ctxt); return 1; } @@ -1051,6 +1049,7 @@ int lookup_mount(struct autofs_point *ap debug(ap->logopt, MODPREFIX "check indirect map lookup failed"); + return NSS_STATUS_NOTFOUND; } } diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c index 7255794..3b8c4ae 100644 --- a/modules/lookup_hosts.c +++ b/modules/lookup_hosts.c @@ -186,6 +186,7 @@ done: ap->entry->current = source; debug(ap->logopt, MODPREFIX "%s -> %s", name, me->mapent); + ret = ctxt->parse->parse_mount(ap, name, name_len, mapent, ctxt->parse->context); diff --git a/modules/lookup_program.c b/modules/lookup_program.c index eb18638..1cdbf80 100644 --- a/modules/lookup_program.c +++ b/modules/lookup_program.c @@ -334,7 +334,7 @@ int lookup_mount(struct autofs_point *ap } if (mapp == mapent || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { - error(ap->logopt, MODPREFIX "lookup for %s failed", name); + msg(MODPREFIX "lookup for %s failed", name); goto out_free; } diff --git a/modules/mount_bind.c b/modules/mount_bind.c index 22abd91..96ca29b 100644 --- a/modules/mount_bind.c +++ b/modules/mount_bind.c @@ -66,6 +66,7 @@ int mount_init(void **context) } debug(LOGOPT_NONE, MODPREFIX "bind_works = %d", bind_works); + spawnl(log_debug, PATH_UMOUNT, PATH_UMOUNT, "-n", tmp2, NULL); diff --git a/modules/mount_changer.c b/modules/mount_changer.c index 83e6bdf..eb29c8c 100644 --- a/modules/mount_changer.c +++ b/modules/mount_changer.c @@ -129,9 +129,8 @@ int mount_mount(struct autofs_point *ap, } if (err) { - error(ap->logopt, - MODPREFIX "failed to mount %s (type %s) on %s", - what, fstype, fullpath); + msg(MODPREFIX "failed to mount %s (type %s) on %s", + what, fstype, fullpath); if (ap->type != LKP_INDIRECT) return 1; @@ -141,9 +140,8 @@ int mount_mount(struct autofs_point *ap, return 1; } else { - debug(ap->logopt, - MODPREFIX "mounted %s type %s on %s", - what, fstype, fullpath); + msg(MODPREFIX "mounted %s type %s on %s", + what, fstype, fullpath); return 0; } } diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c index deebf8b..7774adf 100644 --- a/modules/mount_ext2.c +++ b/modules/mount_ext2.c @@ -145,9 +145,8 @@ #endif } if (err) { - error(ap->logopt, - MODPREFIX "failed to mount %s (type %s) on %s", - what, fstype, fullpath); + msg(MODPREFIX "failed to mount %s (type %s) on %s", + what, fstype, fullpath); if (ap->type != LKP_INDIRECT) return 1; diff --git a/modules/mount_generic.c b/modules/mount_generic.c index 9dabfce..ad726e7 100644 --- a/modules/mount_generic.c +++ b/modules/mount_generic.c @@ -105,9 +105,8 @@ int mount_mount(struct autofs_point *ap, } if (err) { - error(ap->logopt, - MODPREFIX "failed to mount %s (type %s) on %s", - what, fstype, fullpath); + msg(MODPREFIX "failed to mount %s (type %s) on %s", + what, fstype, fullpath); if (ap->type != LKP_INDIRECT) return 1; @@ -117,9 +116,8 @@ int mount_mount(struct autofs_point *ap, return 1; } else { - debug(ap->logopt, - MODPREFIX "mounted %s type %s on %s", - what, fstype, fullpath); + msg(MODPREFIX "mounted %s type %s on %s", + what, fstype, fullpath); return 0; } } diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c index b24f54a..19c0817 100644 --- a/modules/mount_nfs.c +++ b/modules/mount_nfs.c @@ -239,8 +239,7 @@ int mount_mount(struct autofs_point *ap, } if (!err) { - debug(ap->logopt, - MODPREFIX "mounted %s on %s", loc, fullpath); + msg(MODPREFIX "mounted %s on %s", loc, fullpath); free(loc); free_host_list(&hosts); return 0; @@ -254,8 +253,7 @@ int mount_mount(struct autofs_point *ap, /* If we get here we've failed to complete the mount */ - error(ap->logopt, - MODPREFIX "nfs: mount failure %s on %s", what, fullpath); + msg(MODPREFIX "nfs: mount failure %s on %s", what, fullpath); if (ap->type != LKP_INDIRECT) return 1; diff --git a/modules/parse_sun.c b/modules/parse_sun.c index 7dc8339..3f489ed 100644 --- a/modules/parse_sun.c +++ b/modules/parse_sun.c @@ -620,7 +620,7 @@ add_offset_entry(struct autofs_point *ap p_len--; m_key_len = m_root_len + p_len; if (m_key_len > PATH_MAX) { - warn(ap->logopt, MODPREFIX "multi mount key too long"); + error(ap->logopt, MODPREFIX "multi mount key too long"); return CHE_FAIL; } strcpy(m_key, m_root); @@ -633,7 +633,7 @@ add_offset_entry(struct autofs_point *ap m_mapent_len = strlen(loc); if (m_mapent_len + m_options_len > MAPENT_MAX_LEN) { - warn(ap->logopt, MODPREFIX "multi mount mapent too long"); + error(ap->logopt, MODPREFIX "multi mount mapent too long"); return CHE_FAIL; }