Okay, I've been playing with this for a couple of days, and have searched around and not found a solution yet, so I'm gonna ask you guys if anyone can help.
I have a SUSE 10 box fully set up, most services are running just fine, mostly mysql to support Myth and misterhouse for some basic home automation stuff.
Myth is up and running, I just want to get the mythbackend running as a daemon that starts at boot with the other services. I have a script and it is in /etc/init.d and the symbolic links are all created (I did it by hand first, then tried insserv just in case). This script is the very last item called during boot, after GDM and all should be loaded (the script says requires "$ALL").
Basically I have created a user called mythtv and that home folder (/home/mythtv) is where all the recordings will be stored and where the config info is (what isn't in mysql of course).
My first try at starting mythbackend in the init script was this:
Code:
MYTH_ROOT=/home/mythtv/
MYTH_BIN=/usr/local/bin/mythbackend
MYTH_LOG=/home/mythtv/mythbackend_log.txt
test -x $MYTH_BIN || exit 5
start() {
startproc -u mythtv -g video $MYTH_BIN -d -l $MYTH_LOG &
RETVAL=$?
return $RETVAL
}
When I boot the machine I get this:
Quote:
shawn@myth:/home/mythtv> more mythbackend_log.txt
2006-04-19 20:42:04.336 Using runtime prefix = /usr/local
2006-04-19 20:42:04.812 Unable to read configuration file mysql.txt
2006-04-19 20:42:05.807 Trying to create a basic mysql.txt file
2006-04-19 20:42:06.017 Could not create //.mythtv
2006-04-19 20:42:06.348 Failed to init MythContext, exiting.
|
Okay, so it isn't using the right home directory, it is assuming / instead of /home/mythtv. So for fun I try firing it up as another user, and using sudo and get the following:
Quote:
Starting MythBackend done
shawn@myth:/home/mythtv> more mythbackend_log.txt
2006-04-19 20:45:00.154 Using runtime prefix = /usr/local
2006-04-19 20:45:01.199 New DB connection, total: 1
2006-04-19 20:45:01.218 Connected to database 'mythconverg' at host: localhost
2006-04-19 20:45:01.355 Current Schema Version: 1123
Starting up as the master server.
|
That time it has no trouble, it even seems to be properly using /home/mythtv as its home folder.
So for fun I try to use the startproc -c switch to set a root folder:
Code:
MYTH_ROOT=/home/mythtv/
MYTH_BIN=/usr/local/bin/mythbackend
MYTH_LOG=/home/mythtv/mythbackend_log.txt
test -x $MYTH_BIN || exit 5
start() {
startproc -u mythtv -g video -c $MYTH_ROOT $MYTH_BIN -d -l $MYTH_LOG &
RETVAL=$?
return $RETVAL
}
Wow does this fail miserably. No log is created at all during the boot process, so it is failing miserably. And when I try to do it manually:
Code:
shawn@myth:~> sudo /etc/init.d/mythbackend start
Password:
Starting MythBackend startproc: cannot stat /home/mythtv//usr/local/bin/mythbackend: No such file or directory
done
shawn@myth:~>
No go!
I have also tried that second solution by removing the /usr/local/bin specification from $MYTH_BIN in the script, but that doesn't run at all, just stops without any input whether at boot or via sudo manually.
Okay, I'm probably overlooking something very obvious here. Unfortunately mythbackend does not have a switch that allows you to tell it explicitly where to find its dot configuration files/home folder, as that would obviously make things work for me.
Any suggestions what to try? I would really like to get this working. I realize I could do this with autologin of the myth user with a script in that home folder, and then setup the frontend first, but at this time I'm not sure if I will run the frontend and backend on the same machine, so I want to ensure the backend is running whenever possible.
I should also mention that as of now, no other messages are in my system logs except the path issue with try #2 (startproc: cannot stat /home/mythtv//usr/local/bin/mythbackend)