LinHES Forums
http://forum.linhes.org/

Mythfilldatabase Arguments ignored - solved
http://forum.linhes.org/viewtopic.php?f=6&t=8199
Page 1 of 2

Author:  Ralph [ Mon Jan 30, 2006 11:42 pm ]
Post subject:  Mythfilldatabase Arguments ignored - solved

Since upgrading from R5A26 to R5A30.2 I have found that when mythfilldatabase runs automatically, it's ignoring the Argument I've specified. But when I run it manually from a console with arguments, no problem. Moreover, it seems to run whenever it wants to (seems to be around 6.30am) rather than when I specify, eg. between 1am & 2am.

I'm not overly concerned about the latter, but with the Argument being ignored it's meant that I've had to switch off the option to automatically run mythfilldatabase, or else my program times get screwy.

In case it's relevant, the Argument I'm using is
Code:
--graboptions --force-explicit-timezone
although I doubt that's relevant, because I think the arguments just get passed on to the particular tv_grab script I'm using. I suspect for some reason that's not happening...

Any suggestions, please?

Author:  tjc [ Tue Jan 31, 2006 12:03 am ]
Post subject: 

1) Make sure that /etc/cron.daily/mythtv-backend is either removed or if it contains other commands at least no longer contains a mythfilldatabase command.

2) Write an equally simple wrapper script that calls mythfilldatabase with the desired options. Make sure it's executable using chmod +x. Put it somewhere reasonable like the /usr/local/bin/ directory. Yours should look something like this:
Code:
#!/bin/bash
# This is to avoid problems when this is run with the wrong environment.
export HOME=/home/mythtv
/usr/bin/mythfilldatabase --graboptions --force-explicit-timezone


3) Go to the Utilities/Setup -> Setup -> General -> 7th screen and use that script name (use the full path name) as your fill command.

Edited to add setting for HOME.

Author:  Ralph [ Tue Jan 31, 2006 1:14 am ]
Post subject: 

That's great, thanks for the clear instructions, tjc :D
/etc/cron.daily/mythtv-backend contained su mythtv -c "mythfilldatabase --quiet" so I commented that out with a #
Although if this is insufficient and I really need to, eg.
Code:
rm /etc/cron.daily/mythtv-backend
pls let me know.
Wrote the new script (called it mythfilloptions) and changed the setup, also removed the arguments from the setup page as presumably now they're superfluous there anyway.
Then I ran mythfilloptions (as user mythtv) from console, and mythfilldatabase ran AOK.
I will report back again tomorrow after mythfilldatabase has run automatically, to confirm that it's done as it should.
Thanks again.

Author:  tjc [ Tue Jan 31, 2006 9:08 pm ]
Post subject: 

Your real problem was most likely that you were running it twice daily...

BTW - Late night/early morning is NOT a good time to run this stuff for the zap2it servers. If there's another good window, like during the day when you're at work or school, or early evening when your eating dinner or putting the kids to bed, that's generally preferable. Everybody and their inbred neighbor dog piles on those poor servers between 1AM and 5AM...

Author:  Ralph [ Wed Feb 01, 2006 10:17 pm ]
Post subject: 

OK, I think it's running as it should now. Got a '512' error on the last automatic mythfill so I'm not absolutely sure yet - but the times were not screwed up afterwards, which is a good sign.
It still seems to autorun whenever it wants to, rather than between times I sepcify, even if I reboot after re-specifying different times, though. Is there perhaps a way to 'reset' the fill time so that it will auto-run immediately after the next reboot? This would allow me to test it without waiting 24 hours between each auto-run. If not, no matter, I'll just check it again tomorrow.

Author:  Ralph [ Fri Feb 03, 2006 7:28 am ]
Post subject:  FAILED: xmltv returned error code 512

The problem now is that on the last 3 nights when it has run automatically it has always resulted in a '512' error, eg. "Last mythfilldatabase run started on 2006-02-03 23:42 and ended on 2006-02-03 23:42. FAILED: xmltv returned error code 512. There's guide data until 2006-02-09 00:00 (6 days)."
Previously I have only got such errors occasionally. Any idea what's causing this? I have searched but can't find a glossary of XMLTV errors anywhere :!:

But I can still run my new 'mythfilloptions' script manually from a cosole in which case it runs OK, eg. returning "Last mythfilldatabase run started on 2006-02-04 00:14 and ended on 2006-02-04 00:17. Successful. There's guide data until 2006-02-10 03:00 (6 days)."

Author:  tjc [ Fri Feb 03, 2006 8:46 pm ]
Post subject: 

What are the ownerships and permissions of the script? Did you use full pathnames everywhere? For example, here is what my update script looks like:
Code:
root@black2:~# ls -al /usr/local/bin/update_database.sh
-rwxr-xr-x  1 root root 333 Jan 28 16:30 /usr/local/bin/update_database.sh


Go look at the discuusion I've been having with detten for clues on how to debugg this type of stuff.

Author:  Ralph [ Sat Feb 04, 2006 3:28 am ]
Post subject: 

tjc wrote:
Code:
-rwxr-xr-x  1 root root 333 Jan 28 16:30 /usr/local/bin/update_database.sh

Yes my ownerships/permissions are identical to yours and I used the full pathname in the setup screen 7. Only difference was that I called my script mythfilloptions not mythfilloptions.sh - sorry if this is a bit newb but would that make a difference? (I may find out tonight after it does its fill, as I've now added the .sh)

Author:  Ralph [ Sat Feb 04, 2006 5:17 am ]
Post subject: 

OK I now know why it's happening, I should have checked my mythfilldatabase log file earlier, sorry. It says, eg.
Code:
----------------- Start of XMLTV output -----------------
2006-02-03 23:42:29.177 New DB connection, total: 3
Aborting: Config file does not exist:  //.mythtv/Foxtel.xmltv
Do you need to run with --config-file or --configure?
------------------ End of XMLTV output ------------------

which indicates to me that it's looking for my Foxtel.xmltv file in the wrong location - it seems to be running mythfilldatabase as root, rather than as mythtv. Whenever I run it manually I run it as mythtv, so it finds Foxtel.xmltv in /home/mythtv/.mythtv where it's supposed to be.
So the new question is, how come it's running it as root, and how can I correct this :?:

Author:  paulh [ Sat Feb 04, 2006 5:32 am ]
Post subject: 

Not sure if you are having the same problem as me but to get mythfilldatabase to run automatically I had to add
Code:
HOME=/home/mythtv;

before the command to run mythfilldatabase. This is because mythbackend is usually run at startup as root so when it starts mythfilldatabase it inherits the HOME variable of root not the mythtv user that you want.

Also depending on the grabber you are using you may have to add
Code:
--graboptions "--quiet"

to the mythfilldatabase arguments.

Author:  tjc [ Sat Feb 04, 2006 10:52 am ]
Post subject: 

Ralph - the .sh suffix doesn't matter, it's just a clue for yourself about the contents.

As for the script being run as root, it really shouldn't be, since both the front end and the backend ought to be running as the mythtv user. You can see this by running the following command and looking at the user name in the first column.
Code:
ps auxw | grep myth.*end


On the other hand the script needing to be told where to find HOME is exactly the type of thing I was talking about with detten.

paulh - If your backend is running as root you have a problem.

Author:  paulh [ Sat Feb 04, 2006 12:26 pm ]
Post subject: 

tjc wrote:
paulh - If your backend is running as root you have a problem.


First I should say I don't use KnoppMyth I'm a happy Gentoo user :) I'm only here to keep an eye on the development of Mythburn since spit2k1 hangs out here. I'm sure KnoppMyth does a lot of things differently.

I'm using the default setup when you emerge mythtv on gentoo although I now manually install from svn. Gentoo starts mythbackend in the init scripts as a daemon. It does give you the option to change the user that
it should use but I have never given it much thought until now. root must be the default config because I don't think I have ever changed it.

Changing it to something else would open up a whole new can of worms for me because I don't want to leave my system on 24/7 I have the backend shut down when idle and the shutdown scripts run stuff that needs root priviledges like nvram-wake and grub.

When I look at all the other daemons on my system with root priviledges I have to wonder why is it such a big problem that mythbackend is :?

Author:  tjc [ Sat Feb 04, 2006 12:47 pm ]
Post subject: 

On a KnoppMyth system it'd be be ownerships and where things are. For example running mythfilldatabase as root rather than mythtv does some wonky things with channel icons and the like. YMMV running a different installation.

Author:  Ralph [ Mon Feb 06, 2006 8:26 am ]
Post subject: 

Thanks guys, OK so I take it this is what I ought to have in setup for 'mythfilldatabase path'
Code:
HOME=/home/mythtv; /usr/local/bin/mythfilloption.sh
I'll give that a shot and should be able to let you know in about 24 hours what happens...tried running it from console as root and it worked, so I think this just may do the trick.
As for the "--quiet" argument, I've seen that referred to many times but never worked out what it means :?: (I don't think I need to use it with my grabber though, as I never have done - but if I wanted to do so, I guess I would, with my current setup, have to include it as part of my 'mythfilloptions.sh' script, rather than in the Arguments field of the setup screen?)

Author:  tjc [ Mon Feb 06, 2006 7:36 pm ]
Post subject: 

No, put it right inside the /usr/local/bin/mythfilloption.sh script. Right after the magic "#!/bin/bash" line. I'll even go back and edit the example....

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/