Author |
Message |
knathraak
|
Posted: Sat Jun 04, 2005 5:04 pm |
|
Joined: Tue Apr 05, 2005 5:04 am
Posts: 40
|
Thursday night I reverted back to r5a12 after an upgrade didn't go smoothly.
Since then it's been working fine. Just now I powered off the machine (possibly first time since thurs night) to swap cdrom drives. Now mythbackend won't start from the init script. If I run:
Code: $ mythbackend & it works fine. But starting it from the init script: Code: # /etc/init.d/mythbackend start
causes the backend not to run. log entries complain about not being able to read mysql.txt and not being able to create ~/.mythtv. I restore my home directory, preseving permissions so everything should be fine there. just to be sure I checked the permissions and both ~/.mythv/ and mysql.txt are owned by mythtv:mythtv and are world readable.
Any suggestions?
Thanks
|
|
Top |
|
 |
Xsecrets
|
Posted: Sat Jun 04, 2005 6:27 pm |
|
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location:
Nashville, TN
|
did you happen to create a user called mythtv for the regular user? the instructions specifically tell you not to do this.
_________________ Have a question search the forum and have a look at the KnoppMythWiki.
Xsecrets
|
|
Top |
|
 |
knathraak
|
Posted: Sat Jun 04, 2005 10:26 pm |
|
Joined: Tue Apr 05, 2005 5:04 am
Posts: 40
|
Xsecrets wrote: did you happen to create a user called mythtv for the regular user? the instructions specifically tell you not to do this.
Actually, I didn't. I noticed some others were having similar problems due to that. When I first set up myth on Ubuntu, i learned the hard way.
Not so with knoppmyth. I let it do all the magic.
passwd:
Code: mythtv@myth:~$ grep mythtv /etc/passwd mythtv:$1$GLU854Ty$NGBuJMMLs4jXBFBVAox9U/:105:105::/home/mythtv:/bin/bash mythtv@myth:~$ grep mythtv /etc/group cdrom:*:24:mythtv,myth audio:!:29:mythtv,myth video:!:44:mythtv,myth mythtv:x:105: mythtv@myth:~$
(yes I know i posted the password hash for mythtv. really, don't bother running john against it.)
anything else to check for?
|
|
Top |
|
 |
tjc
|
Posted: Sun Jun 05, 2005 1:59 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
Are you remembering to run it with a "su - mythtv ..." wrapper so it doesn't try running as root?
|
|
Top |
|
 |
Xsecrets
|
Posted: Sun Jun 05, 2005 2:36 pm |
|
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location:
Nashville, TN
|
well when running it from init.d it shouldn't require the su mythtv, though I suppose it's possible he ran it for the first time as root, and it created some file that subsiquently are not editable by mythtv when it gets run from init.d
_________________ Have a question search the forum and have a look at the KnoppMythWiki.
Xsecrets
|
|
Top |
|
 |
Iceman
|
Posted: Wed Jun 08, 2005 5:07 pm |
|
Joined: Tue Apr 13, 2004 1:47 pm
Posts: 62
Location:
Turin
|
I had the same problem sometime ago...
It's simple, just put this line in the mythbackend init.d script (in the top):
HOME=/home/mythtv
In this way, it found .mythtv/mysql.txt it search...
_________________ Sito italiano sull'HTPC e MythTV. www.htpcpoint.it
|
|
Top |
|
 |
knathraak
|
Posted: Thu Jun 09, 2005 11:05 am |
|
Joined: Tue Apr 05, 2005 5:04 am
Posts: 40
|
Thanks for the tips.
Quote: Are you remembering to run it with a "su - mythtv ..." wrapper so it doesn't try running as root? When I run the init script from init.d, i run it as root, but the init script transitions to the mythtv user before running mythtbackend. Quote: I had the same problem sometime ago... It's simple, just put this line in the mythbackend init.d script (in the top): HOME=/home/mythtv
In this way, it found .mythtv/mysql.txt it search...
I'll give this a try. wonder why $HOME isn't already defined?
Strange that before I reinstalled, I didn't have to do this.
Thanks again, and I'll give this a try.
|
|
Top |
|
 |
knathraak
|
Posted: Thu Jun 09, 2005 12:16 pm |
|
Joined: Tue Apr 05, 2005 5:04 am
Posts: 40
|
I've been experimenting. When I used sudo to start the myth-backend init script, it runs fine. This is because using sudo the script is run within your own shell but with su priviledges, so it get $HOME from your environment. However when the script is run by init (as root) at bootup or when I su then run it, $HOME = /root, so clearly it can't read $HOME/.mythtv/mysql.txt.
Here's what I don't get. The start-stop-daemon program that starts the mythbackend changes to the mythtv user when running /usr/bin/mythbackend. How is it supposed to get $HOME from the mythtv user's environment, and why isn't it?
One other thing I can think of that may be related is ownerships of any of the files under /etc. When I restored my /etc/ directory, I screwed up preserving some of the ownerships, so to fix things I chowned root:root everything under etc. Was I wrong in doing this? Does any one know of anything that should be owned by some other user? To check run the following command:
Code: find /etc -gid +0 -or -uid +0
which finds anything under /etc that is owned by a user or group other than root.
I appreciate any input or suggestions on this.
Thanks
|
|
Top |
|
 |
knathraak
|
Posted: Thu Jun 09, 2005 7:01 pm |
|
Joined: Tue Apr 05, 2005 5:04 am
Posts: 40
|
Okay sorry to keep replying to my own post.. but I gave r5a16 another try tonight...with success, so the problem is now moot. However any insights to what may have been causing this would still be appreciated. Very perplexing, indeed.
|
|
Top |
|
 |