From ArchWiki
Latest comment: 28 May 2019 by Frececroka in topic Missing thumbnails for large files

the old tumbler watcher

This was the original tumblerd killer script from [1] – it also tries to kill tumblerd once more if it sees open files under /media

# 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:
# The author has no responsibility for the execution. Feel free to distribute and modify it.
# Advice are welcome to
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
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
  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/
# list opened files again
  for opened_file in `cat /tmp/tumblerd.lsof.old`
# if some file was open before....
     grep $opened_file /tmp/ && kill $sg $pid && echo "`date` PID $pid ^^^^^^^^^^^^^^^^^^^^^^^^" && continue
# ...and it's still hung open, kill tumblerd

—This unsigned comment is by Unhammer (talk) 11:47, 5 September 2014‎. Please sign your posts with ~~~~!

Linking the edits that replaced this script in the article with another one: [2]. -- Kynikos (talk) 02:36, 6 September 2014 (UTC)Reply[reply]

Missing thumbnails for large files

By default, tumblerd only creates thumbnails for video files under 2G. Larger files are silently skipped. This can be solved by configuring tumblerd appropriately, but the wiki page does not mention this. Would it make sense to include this information?

The necessary configuration steps are:

  1. If not done previously, copy /etc/xdg/tumbler/tumbler.rc to ~/.config/tumbler/tumbler.rc.
  2. In the copied file, search for the section [FfmpegThumbnailer] and change the MaxFileSize as desired. Setting MaxFileSize=0 generates thumbnails for files of arbitrary size.

Frececroka (talk) 19:10, 28 May 2019 (UTC)Reply[reply]