[mythtv-users] MythTV start up problems (permissions)

Marc drayson at net1plus.com
Sun Jan 20 17:06:10 UTC 2008

> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org [mailto:mythtv-users-
> bounces at mythtv.org] On Behalf Of Piers Kittel
> Sent: Sunday, January 20, 2008 10:52 AM
> To: Discussion about mythtv
> Subject: Re: [mythtv-users] MythTV start up problems (permissions)
> Marc,
> Thanks very much for your time, it is appreciated!
> > First, tell me what user you are logged into the system as when you
> > start mythbackend by hand.
> Root.  Which probably explains why it all works ;)
> > Next connect to mysql at the command line.
> > At the mysql> type the following
> > USE mysql;
> > Then type
> > SELECT Host, User FROM user;
> > Then respond back with the results.
> destiny:/home/piers# mysql -u mythtv -p
> Enter password:
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 25
> Server version: 5.0.32-Debian_7etch1-log Debian etch distribution
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> mysql> USE mysql;
> Reading table information for completion of table and column names You
> can turn off this feature to get a quicker startup with -A
> Database changed
> mysql> SELECT Host, User FROM user;
> +--------------+------------------+
> | Host         | User             |
> +--------------+------------------+
> | 192.168.1.%  | mythtv           |
> | | mythtv           |
> | destiny      | root             |
> | localhost    | debian-sys-maint |
> | localhost    | mythtv           |
> | localhost    | piers            |
> | localhost    | root             |
> +--------------+------------------+
> 7 rows in set (0.00 sec)
> mysql>
> > Then post the entire startup script that Debian uses for myth. I use
> > Gentoo so I don't have an example of this.
> Attached to this email.
> Thanks again for your time!
> Regards - Piers

I think I know what the problem is.
When you ran the start script "/etc/init.d/mythtv-backend start mythbackend
already running, use restart instead." You had started Myth once before but
it crashed.
When this happens on my myth box the script still believes that the process
is still running.

If you do a ls -al /var/run/mythtv you probably will see the following
drwxr-xr-x 4 root root 4096 Jan 18 23:32 .
drwxr-xr-x 3 root root 4096 Jan 16 23:57 ..
drwxr-xr-x 3 root root 4096 Jan 16 23:57 .mythtv
drwxr-xr-x 2 root root 4096 Jan 16 23:57 .qt
-rw-r--r-- 1 root root    5 Jan 18 23:32 mythbackend.pid

If you see the pid file do this
/etc/init.d/mythtv-backend zap
Not sure if zap is a proper option in debian but in gentoo this kills the
pid file, which is what tells the script that the process is still running.
One more thing, if you have a .mythtv folder in /var/run/mythtv check it for
a mysql.txt file. Open said file and make sure the user/pass for your mysql
connection are correct.

There may be one more issue as well. With Gentoo there are no files in the
/var/run folder at each boot, the folders are all there but empty. So while
the .mythtv folder exists, there is no mysql.txt file at boot.
If debian is the same way then when you reboot the machine the mysql.txt
file from the folder is missing and then when the backend starts it
recreates a new file with the default settings. If you changed the password
for the default mythtv sql login you will always get permissions errors.
The reason you are able to start the backend with root is probably because
you have a valid mysql.txt file in /root/.mythtv, or wherever debian puts
the root home folder.

The dirty fix for this error is to change the location of where the pid file
is saved.
You can do this by editing your startup script and changing the RUNDIR= line
to a new location. This will allow you to create a mysql.txt file in the new
location inside the .mythtv folder of the new location that will delete the
file every time you startup the system. Negatives to this? None but the fact
that the pid file is not in the /var/run folder like the rest of them.
My location is /etc/conf.d/mythtv. You may need to create the folder before
putting it in the RUNDIR line.

If this doesn't resolve the issue get back to me.


More information about the mythtv-users mailing list