View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 6 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: R6Mythfilldatabase
PostPosted: Sat Mar 21, 2009 12:00 am 
Offline
Joined: Wed Feb 15, 2006 3:18 pm
Posts: 47
Just did some logging to try and debug a mythfilldatabase issue and found it to be running as root. I have it configured via the mythtv interface and it runs at 1am everyday. This means the config files need to be installed in the root home directory among other things. Anyone have any ideas on how to run it as mythtv instead or root ????

_________________
--
2.4 GHz P4 - 1GB Ram - 200 GB HardDisk
2 x DVICO DVB-T Lite
nVidia 7300GT - DVICO PCI Remote - R6
Wifey loves it more than me.
--


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 21, 2009 12:19 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Use "su -". My old wrapper script says something like this to prevent exactly the problem you described and some other related ones, where the "fill_options" are set by the first half of the script:

Code:
case $(id -nu) in
root)
    su - mythtv -c "nice /usr/bin/mythfilldatabase $fill_options"
    result=$?
    ;;
mythtv)
    nice /usr/bin/mythfilldatabase $fill_options
    result=$?
    ;;
*)
    fatal "You must run this script at mythtv or root!"
    ;;
esac


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 21, 2009 3:58 pm 
Offline
Joined: Wed Feb 15, 2006 3:18 pm
Posts: 47
TJC: Thanks for the reply and thats a great idea. I copied that to a script and tried it but it comes with an error while running. Mythfilldatabase says unable to run tv_grab_au --capabilities and complains about XMLTV being out of date. If I run the script as the mythtv user it is fine. I think it may be a permission problem with the grabber but mythfilldatabase runs fine if i run it manually.

Here is my exact script any ideas would be appreciated:

Code:
case $(id -nu) in
root)
    su - mythtv -c "nice /usr/bin/mythfilldatabase $*"
    result=$?
    ;;
mythtv)
    nice /usr/bin/mythfilldatabase $*
    result=$?
    ;;
*)
    fatal "You must run this script at mythtv or root!"
    ;;
esac

_________________
--
2.4 GHz P4 - 1GB Ram - 200 GB HardDisk
2 x DVICO DVB-T Lite
nVidia 7300GT - DVICO PCI Remote - R6
Wifey loves it more than me.
--


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 21, 2009 8:00 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
This usually means that you're missing some environment setting, usually "PATH" or "HOME". I've described how to debug this many times before, so searching for posts that mention "env" with me as the author should provide the details. OBTW - Also search for "update_database.sh" which will lead you to the complete script.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 22, 2009 2:48 am 
Offline
Joined: Wed Feb 15, 2006 3:18 pm
Posts: 47
Thanks again tjc I will look into it. ATM I have a cron that runs mythfilldatabase as mythtv but it would be cleaner to resolve the issue.

_________________
--
2.4 GHz P4 - 1GB Ram - 200 GB HardDisk
2 x DVICO DVB-T Lite
nVidia 7300GT - DVICO PCI Remote - R6
Wifey loves it more than me.
--


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 22, 2009 5:10 pm 
Offline
Joined: Wed Mar 19, 2008 5:26 pm
Posts: 14
Location: Brisbane, QLD, Australia
For what it is worth I had the same problem so I hacked up the following quick script to run mythfilldatabase as mythtv.
Code:
#!/bin/sh
# Format options for use in su -c "..." command
OPTIONS=""
while [ -n "$*" ]
do
  OPTIONS="$OPTIONS '$1'"
  shift
done

su -c "mythfilldatabase $OPTIONS "  mythtv

Then I set the mythfilldatabase command under the automatically run mythfilldatabase setting screen (somewhere like LinHES->Myth Settings->Settings->General...) to use sudo to ensure the command was initially run as root (I noticed it is run as mythtv if you run it manually from the mythwelcome menu):
Code:
sudo mythtv_filldatabase

You can set the options and logfile in the settings screen to whatever you want and it should be handled appropriately by the script.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Bing [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu