Results 1 to 10 of 13

Thread: updatedb.mlocate running constantly - never stops

Hybrid View

  1. #1
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Arrow updatedb.mlocate running constantly - never stops

    I am running a fresh install of Jaunty. The updatedb.mlocate process is running all the time. It never stops unless I reboot (which I prefer not to do for months).

    I would like to not have updatedb.mlocate running all the time. It could run nightly if it finishes in an hour or less. Otherwise, I will run it weekly (assuming it finishes in a reasonable time).

    I have a 150 GB Raptor HDD, and all my main directories under /home are on an NFS mount (see info below). I have several other mounted file systems and they are mounted in different places (to make the path on my machine match the path on the server so symlinks work correctly).

    The content of my /etc/updatedb.conf are:
    Code:
    PRUNE_BIND_MOUNTS="yes"
    # PRUNENAMES=".git .bzr .hg .svn"
    PRUNEPATHS="/tmp /var/spool /media"
    PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpf$
    The contents of my /etc/cron.daily/mlocate are:
    Code:
    #! /bin/bash
    
    set -e
    
    [ -x /usr/bin/updatedb.mlocate ] || exit 0
    
    if which on_ac_power >/dev/null 2>&1; then
        AC_POWER=0
        on_ac_power >/dev/null 2>&1 || AC_POWER=$?
        if [ "$AC_POWER" -eq 1 ]; then
        echo >&2 "On battery power, not running today."
        exit 1
        fi
    fi
    
    ##
    
    LOCKFILE="/var/lib/mlocate/daily.lock"
    
    trap "rm -f $LOCKFILE" EXIT
    
    if [ -e "$LOCKFILE" ]; then
        echo >&2 "Warning: $LOCKFILE present, not running today."
        exit 1
    else
        touch "$LOCKFILE"
    fi
    
    ##
    
    # See ionice(1)
    if [ -x /usr/bin/ionice ] &&
        /usr/bin/ionice -c3 true 2>/dev/null; then
        IONICE="/usr/bin/ionice -c3"
    fi
    
    $IONICE /usr/bin/updatedb.mlocate
    examples of my mounted file systems are:
    Code:
    /backups
    /shared
    /home/myuser/Documents
    /home/myuser/Pictures
    /home/myuser/Music
    Here is a typical entry from /etc/fstab:
    Code:
    10.10.1.1:/home/myuser/Documents /home/myuser/Documents nfs auto,rw,rsize=8192,wsize=8192,hard,intr 0 0
    This is what iotop usually shows:
    Code:
    Total DISK READ: 0 B/s | Total DISK WRITE: 38.69 K/s
      PID USER      DISK READ  DISK WRITE   SWAPIN    IO<    COMMAND                
    27877 root           0 B/s   38.69 K/s  0.00 %  0.00 % updatedb.mlocate
    I appreciate any suggestions on how to stop mlocate from running all the time.

  2. #2
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Question Re: updatedb.mlocate running constantly - never stops

    anyone have suggestions? mlocate never stops running!

  3. #3
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: updatedb.mlocate running constantly - never stops

    Hi,
    Your /etc/updatedb.conf looks like it might be truncated...the PRUNEFS line for me is:
    Code:
    PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf"
    The inclusion of nfs in that list should cause updatedb to skip your nfs-mounts by the way, which shouldn't leave very much work for updatedb to do, so I would have expected it to finish pretty quickly.

  4. #4
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Re: updatedb.mlocate running constantly - never stops

    Quote Originally Posted by DaithiF View Post
    Hi,
    Your /etc/updatedb.conf looks like it might be truncated..

    The inclusion of nfs in that list should cause updatedb to skip your nfs-mounts by the way, which shouldn't leave very much work for updatedb to do, so I would have expected it to finish pretty quickly.
    Thank you. My /etc/updatedb.conf is correct. The truncation is only the result of the way I copied and pasted. Here is the actual file:
    Code:
    cat /etc/updatedb.conf
    PRUNE_BIND_MOUNTS="yes"
    # PRUNENAMES=".git .bzr .hg .svn"
    PRUNEPATHS="/tmp /var/spool /media"
    PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf"
    I also expected all my nfs-mounts would be skipped on the basis of this config; however, something is wrong somewhere. Do you have any suggested troubleshooting steps?
    Last edited by MountainX; August 20th, 2009 at 02:08 PM.

  5. #5
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: updatedb.mlocate running constantly - never stops

    I would suggest running it manually in a terminal , and with the -v option so that you can see what its doing. The -v option should make it output the paths as it is scanning them, so you can maybe see what its doing for such a long time. Pipe the output into tee to save it to a file for inspection later too.

    Code:
    sudo updatedb.mlocate -v | tee updatedb.log

  6. #6
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Re: updatedb.mlocate running constantly - never stops

    Is there a safe/proper way to terminate the currently running mlocate process other than to kill it? Is killing it while it is running OK?

    EDIT: also, what is the recommended way to remove it from cron? Just delete mlocate from /etc/cron.daily?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •