[mythtv-users] I broke my mythTV, help!

Bill Meek keemllib at gmail.com
Tue Nov 6 05:03:44 UTC 2018


On 11/5/18 10:28 PM, Douglas Peale wrote:
> On 11/5/18 7:42 PM, Bill Meek wrote:
>> On 11/5/18 9:20 PM, Douglas Peale wrote:
>>> sudo systemctl enable mythtvbackend
>>> Failed to enable unit: Unit file mythtvbackend.service does not exist.
>>>
>>> Hmm, wrong name.
>>
>> My typo, but in your previous post (bottom of this) the service
>> name was mythbackend.service.
>>
>> You have two instances of the service. The one in the 1st post:
>>
>>      /etc/systemd/system/mythbackend.service
> There were two mythbackend files there, mythbackend.service, and mythbackend.service.d I moved both to my home directory in case
> I need to put them back.
>>
>> and the one just below:
>>
>>      /lib/systemd/system/mythtv-backend.service
>>
>> Disable one, I'd remove the one in /etc. Do a:
>>
>>      sudo systemctl daemon-reload
>>
>> after that.
>>
>> As to the DB login failure, make sure the password in
>> ~mythtv/.mythtv/config.xml is correct (you may have
>> config.xml in a different place. The systemctl cat...
>> mentioned before should help you locate where it is.
> 
> I have verified that I can log into the database, and the password in the config.xml file is the same one I used to log in.
> 
> Interestingly, the mythtv-backend.service refers to mythbackend

That's correct if you're referring to the ExecStart line.

> 20:16:42:/lib/systemd/system
> $ cat mythtv-backend.service
> [Unit]
> Description=MythTV Backend
> Documentation=https://www.mythtv.org/wiki/Mythbackend
> After=mysql.service network.target
>   
> [Service]
> User=mythtv
> EnvironmentFile=-/etc/mythtv/additional.args
> ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
> StartLimitBurst=10
> StartLimitInterval=10m
> Restart=on-failure
> RestartSec=1
>   
> [Install]
> WantedBy=multi-user.target
> 
> 
> This is the content of mythbackend.service:
> 
> 20:19:21:~
> $ cat mythbackend.service
> [Unit]
> Description=MythTV backend service
> # The following line will cause mythbackend to be terminated if the database dies.
> # If you do not want this then use a weaker binding such as "Requires" or "Wants".
> BindsTo=mysql.service
> Wants=network-online.target
> After=mysql.service network-online.target
> 
> # Persistently named adapters
> # Needs a systemd tag added to your udev persistent naming rules
> #Requires=dev-dvb-adapter0-frontend0.device
> #After=dev-dvb-adapter0-frontend0.device
> 
> [Service]
> # Wait for a dbus notification from mythbackend before starting other services
> # This is enabled by default 0.28 onwards (may be in 0.27 as well)
> # To disable this change type to simple
> Type=notify
> NotifyAccess=main
> 
> # Allow core dumps
> # The core resource limit on the user specified below can reduce what
> # is specified here. So it needs to be set as well.
> LimitCORE=infinity
> 
> User=mythtv
> 
> StandardOutput=null
> StandardError=journal
> 
> ExecStart=/full/path/to/mythbackend $MYTHBACKEND_ARGS
> 
> [Install]
> WantedBy=multi-user.target
> 
> 
> For completeness, I'm including the results of the cat:
> 
> There was nothing for mythtvbackend.
> 
> $ sudo systemctl cat mythbackend
> # /etc/systemd/system/mythbackend.service
> [Unit]
> Description=MythTV backend service
> # The following line will cause mythbackend to be terminated if the database dies.
> # If you do not want this then use a weaker binding such as "Requires" or "Wants".
> BindsTo=mysql.service
> Wants=network-online.target
> After=mysql.service network-online.target
> 
> # Persistently named adapters
> # Needs a systemd tag added to your udev persistent naming rules
> #Requires=dev-dvb-adapter0-frontend0.device
> #After=dev-dvb-adapter0-frontend0.device
> 
> [Service]
> # Wait for a dbus notification from mythbackend before starting other services
> # This is enabled by default 0.28 onwards (may be in 0.27 as well)
> # To disable this change type to simple
> Type=notify
> NotifyAccess=main
> 
> # Allow core dumps
> # The core resource limit on the user specified below can reduce what
> # is specified here. So it needs to be set as well.
> LimitCORE=infinity
> 
> User=mythtv
> 
> StandardOutput=null
> StandardError=journal
> 
> ExecStart=/full/path/to/mythbackend $MYTHBACKEND_ARGS

This is an example path, not a real one. This service will never work.
Make sure it's disabled. Again, I'd remove this one. The override below too,
as it just overrides this non-working service.

> 
> [Install]
> WantedBy=multi-user.target
> 
> # /etc/systemd/system/mythbackend.service.d/environment.conf
> [Service]
> # Command line arguments to be passed by systemd to mythbackend on startup.
> # This variable must be defined or the service will not start.
> Environment="MYTHBACKEND_ARGS=--logpath=/home/roger/logs --verbose=none,dvbsicache,tempdebug:debug"
> 
> # Environment variables for the mythbackend program itself
> Environment=MYTHCONFDIR=/etc/mythtv



> $ sudo systemctl cat mythtv-backend
> # /lib/systemd/system/mythtv-backend.service
> [Unit]
> Description=MythTV Backend
> Documentation=https://www.mythtv.org/wiki/Mythbackend
> After=mysql.service network.target
>   
> [Service]
> User=mythtv
> EnvironmentFile=-/etc/mythtv/additional.args
> ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
> StartLimitBurst=10
> StartLimitInterval=10m
> Restart=on-failure
> RestartSec=1
>   
> [Install]
> WantedBy=multi-user.target

This service looks good and should be enabled. User=mythtv, and therefore
the contents of ~mythtv/.mythtv/config.xml is in play.

Using systemctl cat anyServiceName, as you did above, is always best.
Note that doing that tells you the actual path to the service. You
never need to figure out where the services lives.

 From earlier email:

Nov 05 19:16:23 Compromise mythbackend[30521]: mythbackend[30521]: E CoreContext mythdbcon.cpp:243 (OpenDatabase) Driver error
was [1/1045]:
                                                QMYSQL: Unable to connect
                                                Database error was:
                                                Access denied for user 'mythtv'@'localhost' (using password: YES)

Was this the command line that worked and allowed you to login?

     mysql --host=localhost --user=mythtv --password mythconverg

> (deleted a bunch of e-mail history here)



-- 
Bill


More information about the mythtv-users mailing list