View previous topic :: View next topic |
Author |
Message |
anxt Apprentice
Joined: 25 Feb 2003 Posts: 254 Location: Frozen Tundra, Canada
|
Posted: Sat Apr 23, 2005 2:34 am Post subject: mythbackend init script ignores /etc/mythtv/mysql.txt |
|
|
i can connect to my database remotely as user mythtv.
i can start the backend as root. i cannot use the init script or it tries to connect to a local mysql, not the remote one specified.
what gives?
Code: | ezekiel mythtv # mysql -h isaiah -u mythtv -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 4.0.24
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> |
Code: | ezekiel mythtv # grep DB /etc/mythtv/mysql.txt
DBHostName=isaiah
DBUserName=mythtv
DBPassword=mythtv
DBName=mythconverg
DBType=QMYSQL3
|
Code: | ezekiel mythtv # tail -n 8 /var/log/mythtv/mythbackend.log
Couldn't open database
2005-04-14 17:38:05.815 Unable to connect to database!
2005-04-14 17:38:05.816 Driver error was [1/2002]:
QMYSQL3: Unable to connect
Database error was:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Couldn't open database |
|
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Sat Apr 23, 2005 4:47 am Post subject: |
|
|
Please, someone, for the love of Gentoo, what's our problem?
Anxt, if this helps at all, it happened to me once I upgraded one of my frontends to 0.17-r1 Although, right about that same time, I did throw in a new MBE, but the version didn't change on that...
If you get anything working, by all means, throw it up!
As an addition:
I can start mythbackend by hand no problem, and it runs great, as any user. It's only when using the init script /etc/init.d/mythbackend that this happens.
Hopefully 0.18 ebuilds will be out soon, and we'll see if that offers a fix.
Cool |
|
Back to top |
|
|
anxt Apprentice
Joined: 25 Feb 2003 Posts: 254 Location: Frozen Tundra, Canada
|
Posted: Sat Apr 23, 2005 10:11 am Post subject: |
|
|
ebuilds for .18 are available (masked). they don't help. i will take a look at the init script soon and see what i can see.
right now i am wondering about openmosix though
i will keep you posted.
fwiw, you could just start mythbackend from /etc/conf.d/local.start
mythbackend -d |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Sat Apr 23, 2005 2:30 pm Post subject: |
|
|
Thanks, I'll do it that way versus what I've been doing:
screen
mythbackend &
CTRL + a + d (to detach)
Then closing down the session.
Yeah, I just upped to .18 last night and came in very hopeful this morning, but nothing. Came here to report, but see you already knew
Hopefully we can get this figured out, there's got to be more people having problems with this than just the 2 of us.
Thanks!
Cool |
|
Back to top |
|
|
anxt Apprentice
Joined: 25 Feb 2003 Posts: 254 Location: Frozen Tundra, Canada
|
Posted: Sat Apr 23, 2005 6:34 pm Post subject: |
|
|
i will figure it out. just finished exams so know i can geek out more. |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Mon Apr 25, 2005 8:55 am Post subject: |
|
|
On the mythtv mailing lists, someone pointed out the problem, and then later, the solution, here's the topic:
Quote: | >> I'm building a big nice hidden backend running on Gentoo. Installed ivtv
>> and mythtv 0.17 just fine, and after editing mysql.txt (present in five
>> directories) and running mythsetup it connected fine and appeared as a
>> slave backend to my now-master, soon-to-be-slave backend/frontend.
>>
>> But when I reboot, mythbackend uses /var/run/mythtv/.mythtv/mysql.txt,
>> which is _always_ set to the default values, no matter if I edit it or
>> delete it. Now, the server will of course not be rebooted that often,
>> but
>> I really wouldn't like to have my master backend not start up properly
>> after a power outage... =)
>>
>> /etc/init.d/mythbackend was added to "default" runlevels after
>> compilation
>> had finished.
>>
>> In /etc/conf.d/mythbackend, I have:
>> MYTH_USER=root
>> MYTH_PID=/var/run/mythtv/mythbackend.pid
>>
>> Running from commandline works fine, just can't start the service
>> unless I
>> manually correct /var/run/mythtv/.mythtv/mysql.txt first.
>
> You should put your values in /etc/mythtv/mysql.txt
Turns out the solution was easy; set MYTH_PID in /etc/conf.d/mythbackend
to point to /etc/mythtv/mythbackend.pid . It seems something th the
startup pichs the folder from that value and uses the settings from
there... and if the folder doesn't exist it is recreated.
/ Niklas
|
I guess I'll have a go to see if this works for my situation as well.
Cool |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Mon Apr 25, 2005 9:09 am Post subject: |
|
|
anxt wrote: | i will figure it out. just finished exams so know i can geek out more. |
All next week for me, but then... Look out electric bill, MasterC is havin fun!
Cool |
|
Back to top |
|
|
srwalter n00b
Joined: 10 Mar 2005 Posts: 11 Location: KY
|
Posted: Mon Apr 25, 2005 10:37 pm Post subject: SOLUTION! |
|
|
I've figured out what the cause of this problem is. When the script starts mythbackend, the environment variable HOME gets set to /etc/mythtv. This makes myth look in /etc/mythtv/.mythtv for its configuration files. When you start mythbackend as root, it looks in /root/.mythtv. The solution, then, is to cp -a /root/.mythtv /etc/mythtv. This isn't the most graceful solution, but it will get the init script up and running without having to modify it.
This works for me. If it doesn't work for you, reply and I'll see if I can get you fixed up. |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Tue Apr 26, 2005 1:41 am Post subject: |
|
|
Works great, thanks! It took a combination of the 2 posts to get it working, first, changing /etc/conf.d/mythbackend PID to /etc/mythtv/mythbackend.pid it moved HOME to /etc/mythtv then it search /etc/mythtv/.mythtv for mysql.txt, so I created the directory and moved the file there and it works. I don't understand why it's looking at .mythtv in /etc, but right now I don't care, I'm stoked it worked.
Thanks! |
|
Back to top |
|
|
anxt Apprentice
Joined: 25 Feb 2003 Posts: 254 Location: Frozen Tundra, Canada
|
Posted: Tue Apr 26, 2005 3:57 am Post subject: |
|
|
worked on one box and not the other. go figure.
i am gonna go have a cigarette. |
|
Back to top |
|
|
Prefect47 n00b
Joined: 16 Feb 2004 Posts: 24
|
Posted: Sun May 15, 2005 6:03 pm Post subject: |
|
|
Has the ebuild changed? The init script for mythbackend no longer used the MYTH_PID variable and now it doesn't even look anywhere else for the mysql.txt file - I had to edit the init script to point the pid file to /etc/mythtv/mythbackend.pid and set HOME to /etc/mythtv/, PLUS comy /etc/mythtv/mysql.txt to /etc/mythtv/.mythtv/mysql.txt...
Edit: Oh, and I'm the one who posted the solution on the mythtv-users mailing list... it worked for the 0.17 ebuilds anyway. |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Fri Jun 24, 2005 7:24 pm Post subject: |
|
|
Apparently someone hates us.
I just tried to edit my init file, but it was a no go.
I'm stuck using local to start myth until I can gain a decent solution.
I am perplexed as to why this is even an issue...
I'll search the bug list, if it's not there, I'll post a new one but I'm sure I'll be slammed because I am not a bug reporter generally so I suck compared to those who know what they are doing. |
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
|
Back to top |
|
|
MasterC Apprentice
Joined: 25 May 2003 Posts: 150 Location: Woods Cross, UT
|
Posted: Wed Jun 29, 2005 2:21 am Post subject: |
|
|
Prefect47 wrote: | Has the ebuild changed? The init script for mythbackend no longer used the MYTH_PID variable and now it doesn't even look anywhere else for the mysql.txt file - I had to edit the init script to point the pid file to /etc/mythtv/mythbackend.pid and set HOME to /etc/mythtv/, PLUS comy /etc/mythtv/mysql.txt to /etc/mythtv/.mythtv/mysql.txt...
Edit: Oh, and I'm the one who posted the solution on the mythtv-users mailing list... it worked for the 0.17 ebuilds anyway. |
Is there any chance you can post a step by step process of how you actually did it. I tried hacking mine, but it was still a no go.
Thanks! |
|
Back to top |
|
|
Prefect47 n00b
Joined: 16 Feb 2004 Posts: 24
|
Posted: Thu Jun 30, 2005 8:02 am Post subject: |
|
|
MasterC wrote: | Is there any chance you can post a step by step process of how you actually did it. I tried hacking mine, but it was still a no go.
Thanks! |
http://www.gossamer-threads.com/lists/mythtv/users/126932?search_string=gentoo%20mysql.txt;#126932
I didn't really do anything more than that, and I didn't run 0.18 on my gentoo box that long, since I moved all my hardware into a big server box running FC3 (as per Jarod's install guide for MythTV) and connect to the TV with 15m SVideo cables and a RF remote. Moving the box out of the room is a very effective way to eliminate the noise... =) |
|
Back to top |
|
|
dave77034 n00b
Joined: 27 Apr 2005 Posts: 17
|
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Tue Jun 20, 2006 3:31 pm Post subject: |
|
|
Quote: | The solution, then, is to cp -a /root/.mythtv /etc/mythtv. |
Thanks that fixed it for me for the latest myth (0.19.X) which still exhibited the same bug... _________________ John
My gentoo overlay
Instructons for overlay |
|
Back to top |
|
|
niick Tux's lil' helper
Joined: 09 Mar 2006 Posts: 93
|
Posted: Fri Jul 28, 2006 4:51 pm Post subject: |
|
|
Hello,
I've been having this problem as well. I fixed it by editing the /etc/init.d/mythbackend script.
I changed the two references to the pid files from;
Code: | /var/run/mythbackend.pid | to Code: | /etc/mythtv/mythbackend.pid |
and the HOME variable from;
to (the username on my mythbox is mythtv)
I now get no errors when running /etc/init.d/mythbackend stop, and mythfrontend doesn't complain about a missing backend any more.
Nick |
|
Back to top |
|
|
|