dvd disk not unmounting, tumblerd keeping volume busy

Message
Author
User avatar
Jon_J
Posts: 50
Joined: Tue Jan 21, 2014 7:46 pm

Re: dvd disk not unmounting, tumblerd keeping volume busy

#11 Post by Jon_J »

Is tumbler needed for anything else besides displaying images in the file manager?
If so, I'm going to uninstall it because I hardly ever use thumbnails in a file manager, and thumbnail usage places little files all over your drives.
3 installed files show in synaptic:
libtumbler-1-0
tumbler
tumbler-common

Jon
PC Intel 2.8ghz MX-14.4 | Win XP | Debian 6.09
Dell Mini10 1.6ghz MX-14.4 | antiX-15-b2 | Win XP | Debian 6.09 | Slitaz 5.0
Zaurus SL-C3100 Cacko 1.23 | Angstrom 2007.12-r18 | Ubuntu 9.04 ARMEL
Zaurus SL-C3200 pdaXii13v2-5.5-alpha4 Akita on NAND

User avatar
dolphin_oracle
Developer
Posts: 20010
Joined: Sun Dec 16, 2007 1:17 pm

Re: dvd disk not unmounting, tumblerd keeping volume busy

#12 Post by dolphin_oracle »

it also does the thumbnails for photos if you use the ristretto viewer, but that was axed early on for mirage (a better choice in my mind).
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
Marinos
Posts: 4
Joined: Tue Nov 04, 2014 1:44 am

Re: dvd disk not unmounting, tumblerd keeping volume busy

#13 Post by Marinos »

For those who for some reason NEED to have thumbnails enabled,
there's a little hack suggested by user "twolf" in Linux Mint's forums
about a year ago. He produced a shell script (see code below)
that can be made executable and copied to some convenient location
in the $PATH (typically that'll be /usr/local/bin/ ) and then added to
the startup apps. This script is supposed to somehow tame the daemon
tumblerd so that it will only allocate limited resources in thumbnailing
the media contents of folders.

So, the procedure goes like this:

1. Copy the script below and save it as a file, say tumblerwatcher.sh

2. Make it executable by: sudo a+x tumblerwatcher.sh

3. Copy it to the $PATH by: sudo mv tumblerwatcher.sh /usr/local/bin/

4. Launch Menu -> Settings -> Session and Startup -->go to
"Application autostart" tab and click "add". Give it a suitable name
like "Tumbler Watcher" and as command specify tumblerwatcher.sh

5. Save, exit and reboot.

Test the new setup with, say, a USB drive with a folder loaded with media
files and opened in Thunar. Keep an eye on CPU usage while doing this
(launch htop for that.) If things go well then tumbler won't bring the system
to its knees anymore. Also, it should allow unmounting the media-laden
USB drive within a reasonable time.

Code: Select all

    #!/bin/bash
    # Tumblerdwatcher v 1.0
    # Script to check and kill tumblerd process if a loop is suspected. To be automatically scheduled at user session start.
    # Homemade workaround for bug: http://forums.linuxmint.com/viewtopic.php?f=110&t=97079&p=767460&hilit=tumblerd#p554241
    # The author has no responsibility for the execution. Feel free to distribute and modify it.
    # Advice are welcome to rs2809@yahoo.it.

    period=60                  # check period (sec)
    process="/usr/lib/i386-linux-gnu/tumbler-1/tumblerd"   # tumblerd binary path
    Pcpu=20                     # tolerated cpu usage (%)
    Pmem=25                     # tolerated memory usage (%)
    mountpath="/media"               # automatic mount point for removable storage
    sec=10                     # time limit (sec) for opened file at $mountpath for thumbnail generation
    sg="-15"                  # process termination signal (-15 is OK)
    logpath="/tmp/Tumblerdwatcher.log"         # log path                     

    cat /dev/null > $logpath
    exec >$logpath 2>&1
    # reset log file

    while true
    # execute endlessly

     do

     sleep $period
    # wait a set period of time

     [[ `ps -ef | grep $process | grep -v 'grep' | wc -l` -eq 0 ]] && continue
    # skip to next period if not executing

     ps -eo pcpu,pid,pmem,args | grep $process | grep -v 'grep' | while read dpcpu pid dpmem
    # catch proccess id, cpu usage and memory usage

      do

      pcpu=`echo $dpcpu | cut -d'.' -f1`
      pmem=`echo $dpmem | cut -d'.' -f1`

      [[ $pcpu -gt $Pcpu ]] || [[ $pmem -gt $Pmem ]] && kill $sg $pid && echo "`date` PID $pid $pcpu/$Pcpu %cpu $pmem/$Pmem %mem" && continue
    # if cpu usage or memory usage exceed, kill it and report values in the log file

      [[ `lsof -p $pid | grep $mountpath | wc -l` -eq 0 ]] && continue
    # if no opened file by tumblerd at removable storage mountpoint, skip to next period

      lsof -p $pid | grep $mountpath | tr -s ' ' | cut -d' ' -f9 > /tmp/tumblerd.lsof.old
    # list opened files

      sleep $sec
    # wait for tolerated time limit

      [[ `lsof -p $pid | grep $mountpath | wc -l` -eq 0 ]] && continue
    # if no more opened file skip to next period

      lsof -p $pid | grep $mountpath | tr -s ' ' | cut -d' ' -f9 > /tmp/tumblerd.lsof.new
    # list opened files again

      for opened_file in `cat /tmp/tumblerd.lsof.old`
    # if some file was open before....
       do

         grep $opened_file /tmp/tumblerd.lsof.new && kill $sg $pid && echo "`date` PID $pid ^^^^^^^^^^^^^^^^^^^^^^^^" && continue
    # ...and it's still hung open, kill tumblerd
       done

      done

    done

User avatar
m_pav
Developer
Posts: 1407
Joined: Sun Aug 06, 2006 3:02 pm

Re: dvd disk not unmounting, tumblerd keeping volume busy

#14 Post by m_pav »

Easy work-around, but not a fix. On my youtube channel I have this comment re: the issue with tumbler

There is a downside to having Thunar display thumbnails but it's easy to overcome. If you have a usb device plugged in with pics or videos on it showing in Thunder and you try to unmount it, it can take ages to unmount if there are lots of images or particularly large video files in the folder being viewed on the removeable device. The remedy is simple and effective, simply click on home or any other folder to display anything but the contents of the remove able drive before unmounting it and you'll have no troubles (long waits) whatsoever.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD FX 6100 CPU, nVidia, 8Gb, 3.25TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

User avatar
Marinos
Posts: 4
Joined: Tue Nov 04, 2014 1:44 am

Re: dvd disk not unmounting, tumblerd keeping volume busy

#15 Post by Marinos »

The problem with tumbler is that it's not just causing the occasional
inconvenience, it can actually take over the entire computer, devouring
all of its resources to the point that the system becomes completely
unresponsive! I've witnessed this myself with the latest Xubuntu 14.10.
Some users brand tumbler as malware, for good reason. Makes one wonder,
how come and such a serious shortcoming hasn't been fixed yet.
In the three weeks I had to put up with Xubuntu 14.10, after I started
using twolf's script I did not experience any more such tumbler-related
mishaps. However, it's impossible to judge the script's true effectiveness
in such a short time span.
Thankfully the MX-14 creators chose wisely in not installing tumbler
by default, I'm sure this spared many a user a potential stroke :-)

Post Reply

Return to “Older Versions”