Package: mount
Version: 2.12r-19

We have applications that will automount 25-40 mounts all at once.
When the automount timer expires it will umount most of these all at
once.  Very often, some of them will unmount but umount fails to
remove the entry from /etc/mtab.  The following error appears in
daemon.log:

Aug 22 18:16:37 linus121 automount[8030]: >> Cannot create link /etc/mtab~
Aug 22 18:16:37 linus121 automount[8030]: >> Perhaps there is a stale lock file?

The next time automount tries to mount the stale entry, it fails to
mount stating that it is already mounted.

To fix this issue, I modified the following code in util-linux-2.12r
source code:

~/util-linux-2.12r/mount/fstab.c in routine lock_mtab:

                         /* Limit the number of iterations - maybe there
                         still is some old /etc/mtab~ */
                        if (tries++ > 3) {
                                if (tries > 5)
                                        die (EX_FILEIO, _("Cannot create link %s
\n"
                                            "Perhaps there is a stale lock file?
\n"),
                                             MOUNTED_LOCK);
                                sleep(1);
                        }

What I did was increase the number of tries above to > 5 on the first
loop and > 10 on the second one that sleeps.  Basically, with so many
umounts going on at once, the code was not trying enough times to gain
the lock on mtab before it gave up.  By increasing the number of tries
before giving up, umount had enough time to obtain the lock and update
all the mtab entries.  Please consider upping these values in the main
package if you don't see any harm in doing so.  Thanks.

Rich Wohlstadter
Sys. Admin
Genome Sequencing Center
Washington University of Saint Louis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to