Author Topic: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'  (Read 5029 times)

freymann

  • Douchebag
  • Guru
  • *
  • Posts: 380
    • View Profile
SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« on: July 19, 2008, 05:49:25 pm »
I noticed that I only have 10 days worth of guide info so I did a ps -aux on the core and I see:

Code: [Select]
mythtv   19420  0.0  0.0  17932  1652 ?        S    Jul18   0:00 sh -c /usr/pluto/bin/MythTvDailyFillDB.sh  >>/var/log/mythtv/mythfilldatabase.log 2>&1
mythtv   19421  0.1  0.5  28028 11892 ?        S    Jul18   1:44 /bin/bash /usr/pluto/bin/MythTvDailyFillDB.sh

so I then check the log file and it's full of:

Code: [Select]
We do not want to start until it has been
2 minutes since the MythTV channel download.

Things were ticking along quite nicely... but I wonder if going into mythsetup triggers another mythfilldatabase and for some reason it's created a lock file of some kind...

I don't see mythfilldatabase running on the other MD.

What do I need to do to make it continue?
« Last Edit: July 20, 2008, 06:55:36 pm by freymann »

ogir

  • Regular Poster
  • **
  • Posts: 21
    • View Profile
Re: My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #1 on: July 19, 2008, 06:07:22 pm »
I'm not quite sure if mythfilldatabase should really be triggered on the client, or if going into mythsetup triggers it on the core. (Since the core contains the only database and all MDs only connect to it)

But i'm always willing to learn

Igor
Considering Microsoft, i can understand why mankind invented gas chambers and the electric chair.

freymann

  • Douchebag
  • Guru
  • *
  • Posts: 380
    • View Profile
Re: My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #2 on: July 20, 2008, 06:55:22 pm »
I did a ps -aux |grep -i myth on the core and killed the two mythfilldatabase processes...

Then I went into Myth Setup from the computing screen, and then out, and checked the log and mythfilldatabase was running.

So now I'm back to my 14 days worth of listings.

seth

  • Guru
  • ****
  • Posts: 485
  • A day w/o LinuxMCE is like a day w/o sunshine!
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #3 on: August 19, 2008, 07:49:28 pm »
 :)
I just ran into this problem as well. It appears that the line to ask mythfilldatabase to wait for the mythtv initial fill database script is not getting the information that the initial fill has occurred. I resolved this by commenting out that line in the /usr/pluto/bin/MythTvDailyFillDB.sh script. Mine was hung as well, but I circumvented initially by running it manually. Now it runs without hanging. As the system has been up for quite some time, there is no need to wait any longer for the Initial Fill :)

Check your script, and comment out that line. I will see about getting a mantis ticket open on it.

Regards,

Seth
".....Because Once you've LinuxMCE'd....."
System stats located at my user page:

http://wiki.linuxmce.org/index.php/User:Seth

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #4 on: August 19, 2008, 07:58:40 pm »
I"m having the problem as well. Right now, I'm down to 7 days worth of guide data. I've been running mythfilldatabase manually for quite a while now. Would be very nice if this would keep it populated automatically.

seth

  • Guru
  • ****
  • Posts: 485
  • A day w/o LinuxMCE is like a day w/o sunshine!
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #5 on: August 19, 2008, 08:14:39 pm »
 ;)
Look for this block of text in the /usr/pluto/bin/MythTvDailyFillDB.sh script
Code: [Select]
# Before we lock, make sure MythTVInitialFillDB.sh was not run recently.
# This is so that we don't start this until the user has finished
# configuring MythTV in the configuration Wizard. By checking this
# before we lock we make sure we're not running this script when
# MythTVInitialFillDB.sh needs to be rerun.
# Even if we are MythTvInitFillDB.sh can kill us, but this prevents
# a lot of false starts from happening.
# WaitUntilMythTvInitialRunXMinutesOld 2

The Line I have commented out there WaitUntilMythTvInitialRunXMinutesOld 2 will allow it to run unattended.

Give that a try, I opened a Mantis ticket on it. Hopefully it can easily be resolved.

Regards,

Seth
".....Because Once you've LinuxMCE'd....."
System stats located at my user page:

http://wiki.linuxmce.org/index.php/User:Seth

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #6 on: August 19, 2008, 08:17:53 pm »
yeah, I was looking through the code.. I'm going to have a look tonight at why WaitUntilMythTvInitialRunXMinutesOld in MythTVCommon.sh is not ruturning as it should.

Thanks for pointing this out, as I was starting to get sick of doing it manually

merkur2k

  • Addicted
  • *
  • Posts: 513
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #7 on: April 15, 2009, 07:06:28 pm »
Sorry to dig up an old topic, but I have some info to add to this.
I finally got annoyed enough with having to run mythfilldatabase manually that i dug around in the scripts to see what was going on. As far as I can tell, its from a bug in one of the scripts that causes it to mistakenly believe that an initial database fill is still running.
in /usr/pluto/bin/MythTvCommon.sh is function WaitUntilMythTvInitialRunXMinutesOld starting at line 149:
Code: [Select]
function WaitUntilMythTvInitialRunXMinutesOld {
        STARTTIME=`date +%s`
        if [ -r $FILLDBINITRUN -a -s $FILLDBINITRUN ] ; then
                STARTTIME=$(cat $FILLDBINITRUN)
        fi
This checks for a lockfile containing a timestamp left by the initial db fill script i assume, but what i dont understand is why it doesnt simply return control to the fill database script and let it continue if the lockfile isnt there. So I added a couple additional lines to do just that:
Code: [Select]
function WaitUntilMythTvInitialRunXMinutesOld {
        STARTTIME=`date +%s`
        if [ -r $FILLDBINITRUN -a -s $FILLDBINITRUN ] ; then
                STARTTIME=$(cat $FILLDBINITRUN)
        else
                return
        fi
So far it seems to do as it should, but I also have not given it much testing. I dont know what will happen if the initial db fill is still running.

donpaul

  • Guru
  • ****
  • Posts: 300
    • View Profile
Re: SOLVED - My /MythTvDailyFillDB.sh seems to be 'stuck'
« Reply #8 on: April 15, 2009, 07:39:02 pm »
This is a problem caused by the file being placed in /tmp, which should never happen. The /tmp dir is cleaned on reboot. That file should be put somewhere else besides /tmp, the problem fixed. I touch the /tmp file on reboot so that the fill doesn't break.