[mythtv-users] SystemD (Was: Recommended Linux Distro post CentOS)

R. G. Newbury newbury at mandamus.org
Sat Dec 26 18:08:42 UTC 2020


On 2020-12-26 9:53 a.m., Stephen Worthington wrote:
> On Sat, 26 Dec 2020 06:27:09 -0700, you wrote:
> 
>> On Sat, Dec 26, 2020 at 10:40:17AM +0000, Mike Perkins wrote:
>>> You aren't addressing the actual problem. This is not why systemd isn't
>>> restarting the myth backend but why it is failing to start in the first
>>> place.
>>
>> Well, it's reasonable certain that the reason that mythbackend doesn't start
>> up is that mariadb isn't up yet.  

So we now (finally) know that you have a simple computer setup with a 
BE, FE and db server all on the same box.

1)  Have you tried:
   [Unit]
   Description=MythTV backend service
   After=network-online.target mariadb.service mysqld.service 
time-sync.target

in the mythbackend.service file?
(Note that this lists *both* mariadb.service and mysqld.service. You 
should only have one of these two (possibly one and a soft link as an 
alias to the one doing the heavy lifting).

Try this version, please.

2)  Since you are running on a single box, try ignoring the outside FE's 
for a moment, and set the config.xml to use <Host>Localhost</Host>. This 
'should' avoid any network problems in access and help pinpoint things.

>> Well, whenever I can ssh into the box, everything is up and mythbackend starts
>> up just fine.  Everything the backend needs is on the same box, so shouldn't
>> be any networking issue, mariadb seems the likely culprit.  The "right" way
>> to specify the dependency to systemd doesn't work, and it's just not worth
>> trying random hacks to poke at things to cover the race condition when it
>> involves rebooting the system to test it.  Especially when the problem only
>> happens once or twice a year.  It's "good enough".

3)  And now we can see another possible problem point. You can ssh in, 
and start mythbackend. So what user are you when you ssh in? I always 
use 'root' when ssh'ing into the mythbox, or any of my computers. I 
don't think I have another user authenticated on any machine *for ssh*. 
If you can start mythbackend *as root* there is a fair possibility that 
the problem comes down to your 'mythtv user': either the user does not 
have permission to start mythbackend *at all*, OR the 'mythtv user' is 
not properly authenticated to *talk to the database*.

So: 4) Set up ssh access for your mythtv user (if the box is headless), 
or sit down at the box, boot up (a cold boot for this!), and
5)   try to access mysql: $ mysql-u mythtv -pmythtv -D mythconverg
  to determine if it is a user access problem to the db, and

6)  try to start mythbackend from a console, as the mythtv user. ( I 
will admit that when I run into permissions problems, I use the bigger 
hammer method and just chmod 777 everthing in sight, to start with. Then 
it's down to adding the user to 'wheel' and other smaller corrections.

I have an idea that your problem is in #6. Get that figured out, and you 
can then allow access to the db for users from other boxen, and set the 
<Host> config on those other boxes to point to the IP of the db server 
(the BE/FE/db box config.xml can remain 'localhost'. (If


> You can easily have networking issues on one box - mythbackend is
> known for having one in particular that requires extra systemd config
> when using an external IP address instead of localhost.  So did you do
> any extra systemd config for mythbackend when you changed its config
> to use the external IP address?  If not, then that is the likely cause
> of the problems.
> 
> We still do not know exactly what systemd and mythbackend are being
> told to do.  So could you please post the output of:
> 
> systemctl cat mariadb
> systemctl cat mythbackend
> sudo mysql mythconverg
> select * from settings where value='BackendServerAddr' or
> value='MasterServerIP';
> quit
> ifconfig
> netstat -anp | grep mysql

I think we need the access question answered before further spelunking 
as set out above, are *necessary*. The 'select... MasterServerIP' will 
show where myth thinks the db server lives. In addition, we need to see 
the output of  "ifconfig | grep -h 'inet'" which will tell us what IP 
your box is using. It now occurs to me that there could be a mis-match 
between those two numbers, which would explain a lot!

Geoff









More information about the mythtv-users mailing list