[mythtv-users] I broke my mythTV, help!
Stephen Worthington
stephen_agent at jsw.gen.nz
Wed Nov 7 06:49:00 UTC 2018
On Tue, 6 Nov 2018 20:56:08 -0800, you wrote:
>On 11/6/18 8:31 PM, Stephen Worthington wrote:
>> On Tue, 6 Nov 2018 19:32:14 -0800, you wrote:
>>
>>> I put the mythbackend.system back in place since removing it did not improve anything, and the system was working with both
>>> files in place before I swapped my /home raid.
>>>
>>>
>>> $ 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
>>>
>>> [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
>>>
>> I do not think you have said yet what distro you are running. If it
>> is Ubuntu, then you definitely do not want the
>> /lib/systemd/system/mythbackend.service file - you must have created
>> it yourself, as it is not part of any Ubuntu package. And the
>> mythbackend.service file will not ever work as it currently is, since
>> its ExecStart line is invalid - it does not have the correct path to
>> find the mythbackend executable file. So if you are running Ubuntu, I
>> would recommend that you delete
>> /lib/systemd/system/mythbackend.service. It is a red herring.
>>
>> In Ubuntu from 16.04+, mythbackend is run by systemd from the
>> /lib/systemd/system/mythtv-backend.service file. To find out what
>> that file is doing, use this command:
>>
>> sudo systemctl status mythtv-backend
>>
>> To make sure that mythtv-backend.service is enabled and that it has
>> tried to start mythbackend, do these commands:
>>
>> sudo systemctl daemon-reload
>> sudo systemctl enable mythtv-backend
>> sudo systemctl start mythtv-backend
>>
>> Those commands tell systemd to 1) re-read all its configuration files,
>> 2) set up the mythtv-backend.service unit so that it will
>> automatically be started at boot time, and 3) start the
>> mythtv-backend.service unit. Which hopefully will then attempt to
>> start mythbackend.
>>
>> Then repeat this command:
>>
>> sudo systemctl status mythtv-backend
>>
>> and you can also take a look at /var/log/mythtv/mythbackend.log to see
>> more detail about mythbackend starting up or not.
>>
>> To check if there are any override config files installed for
>> mythtv-backend.service, it would be helpful to see the output of:
>>
>> sudo systemctl cat mythtv-backend
>I had included that in the last e-mail, but I will include it again at the end of this one.
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
>>
>I think I have done something similar before with the same result.
>
>I can assure you that I did not create the mythbackend.service file, I do not know enough about systemd to attempt that.
>
>I am running Linux Mint Cinnamon version 19
>
>System: Host: Compromise Kernel: 4.15.0-38-generic x86_64 bits: 64 gcc: 7.3.0
> Desktop: Cinnamon 3.8.9 (Gtk 3.22.30-1ubuntu1) dm: lightdm Distro: Linux Mint 19 Tara
>Machine: Device: desktop Mobo: ASUSTeK model: P6T DELUXE v: Rev 1.xx serial: N/A
> BIOS: American Megatrends v: 2209 date: 09/21/2010
>CPU: Quad core Intel Core i7 920 (-MT-MCP-) arch: Nehalem rev.4 cache: 8192 KB
> flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 21382
> clock speeds: min/max: 1600/2668 MHz 1: 1703 MHz 2: 1849 MHz 3: 1722 MHz 4: 1714 MHz
> 5: 1736 MHz 6: 1824 MHz 7: 1711 MHz 8: 1789 MHz
>Graphics: Card: NVIDIA GM200 [GeForce GTX 980 Ti] bus-ID: 02:00.0 chip-ID: 10de:17c8
> Display Server: x11 (X.Org 1.19.6 )
> drivers: nvidia (unloaded: modesetting,fbdev,vesa,nouveau)
> Resolution: 3840x2160 at 60.00hz, 2560x1600 at 59.86hz
> OpenGL: renderer: GeForce GTX 980 Ti/PCIe/SSE2 version: 4.6.0 NVIDIA 390.77 Direct Render: Yes
>Audio: Card-1 NVIDIA GM200 High Def. Audio driver: snd_hda_intel bus-ID: 02:00.1 chip-ID: 10de:0fb0
> Card-2 Intel 82801JI (ICH10 Family) HD Audio Controller
> driver: snd_hda_intel bus-ID: 00:1b.0 chip-ID: 8086:3a3e
> Card-3 Microsoft driver: USB Audio usb-ID: 001-003 chip-ID: 045e:0811
> Sound: Advanced Linux Sound Architecture v: k4.15.0-38-generic
>Network: Card-1: Marvell 88E8056 PCI-E Gigabit Ethernet Controller
> driver: sky2 v: 1.30 port: c800 bus-ID: 04:00.0 chip-ID: 11ab:4364
> IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
> Card-2: Marvell 88E8056 PCI-E Gigabit Ethernet Controller
> driver: sky2 v: 1.30 port: d800 bus-ID: 05:00.0 chip-ID: 11ab:4364
> IF: enp5s0 state: down mac: <filter>
>Drives: HDD Total Size: 21622.0GB (9.5% used)
> ID-1: /dev/sda model: OCZ size: 120.0GB serial: <filter>
> ID-2: /dev/sdd model: WDC_WD100EFAX size: 10000.8GB serial: <filter>
> ID-3: /dev/sde model: ST31500341AS size: 1500.3GB serial: <filter>
> ID-4: /dev/sdo model: WDC_WD100EFAX size: 10000.8GB serial: <filter>
>Partition: ID-1: / size: 110G used: 21G (20%) fs: ext4 dev: /dev/sda1
>RAID: System: supported: raid1 linear multipath raid0 raid6 raid5 raid4 raid10
> Device-1: /dev/md1 - active components: online: sdo[1] sdd[0]
> Info: raid: 1 report: 2/2 UU blocks: 9766304768 chunk size: N/A bitmap: true super blocks: 1.2
> Unused Devices: none
>Sensors: System Temperatures: cpu: 46.0C mobo: 47.0C gpu: 0.0:60C
> Fan Speeds (in rpm): cpu: 1406 psu: 0 sys-1: 0 sys-2: 1196 sys-3: 1163
>Repos: Active apt sources in file: /etc/apt/sources.list
> deb http: //download.alephobjects.com/ao/aodeb buster main
> Active apt sources in file: /etc/apt/sources.list.d/freecad-maintainers-freecad-stable-bionic.list
> deb http: //ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu bionic main
> deb-src http: //ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu bionic main
> Active apt sources in file: /etc/apt/sources.list.d/google-earth-pro.list
> deb http: //dl.google.com/linux/earth/deb/ stable main
> Active apt sources in file: /etc/apt/sources.list.d/kdenlive-kdenlive-stable-bionic.list
> deb http: //ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu bionic main
> deb-src http: //ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu bionic main
> Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
> deb http: //mirrors.kernel.org/linuxmint-packages tara main upstream import backport
> deb http: //mirror.math.ucdavis.edu/ubuntu bionic main restricted universe multiverse
> deb http: //mirror.math.ucdavis.edu/ubuntu bionic-updates main restricted universe multiverse
> deb http: //mirror.math.ucdavis.edu/ubuntu bionic-backports main restricted universe multiverse
> deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
> deb http: //archive.canonical.com/ubuntu/ bionic partner
> Active apt sources in file: /etc/apt/sources.list.d/openscad-releases-bionic.list
> deb http: //ppa.launchpad.net/openscad/releases/ubuntu bionic main
> deb-src http: //ppa.launchpad.net/openscad/releases/ubuntu bionic main
> Active apt sources in file: /etc/apt/sources.list.d/skype-stable.list
> deb [arch=amd64] https: //repo.skype.com/deb stable main
>Info: Processes: 302 Uptime: 1:30 Memory: 3147.3/5950.4MB
> Init: systemd v: 237 runlevel: 5 Gcc sys: 7.3.0 Client: Unknown python3.6 client inxi: 2.3.56
>
>Here is a capture of the sequence of commands you requested.
>
>20:38:23:/etc/systemd/system
>$ sudo mv mythbackend.service* ~
>dpeale at Compromise 20:38:43:/etc/systemd/system
>$ cd
>20:39:01:~
>$ sudo systemctl status mythtv-backend
>? mythtv-backend.service - MythTV Backend
> Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
> Active: failed (Result: exit-code) since Tue 2018-11-06 19:15:00 PST; 1h 24min ago
> Docs: https://www.mythtv.org/wiki/Mythbackend
> Process: 2309 ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS (code=exited, status=130)
> Main PID: 2309 (code=exited, status=130)
>
>Nov 06 19:15:00 Compromise systemd[1]: mythtv-backend.service: Service hold-off time over, scheduling restart.
>Nov 06 19:15:00 Compromise systemd[1]: mythtv-backend.service: Scheduled restart job, restart counter is at 10.
>Nov 06 19:15:00 Compromise systemd[1]: Stopped MythTV Backend.
>Nov 06 19:15:00 Compromise systemd[1]: mythtv-backend.service: Start request repeated too quickly.
>Nov 06 19:15:00 Compromise systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
>Nov 06 19:15:00 Compromise systemd[1]: Failed to start MythTV Backend.
>20:39:46:~
>$ sudo systemctl daemon-reload
>20:40:08:~
>$ sudo systemctl enable mythtv-backend
>Synchronizing state of mythtv-backend.service with SysV service script with /lib/systemd/systemd-sysv-install.
>Executing: /lib/systemd/systemd-sysv-install enable mythtv-backend
>20:40:27:~
>$ sudo systemctl start mythtv-backend
>20:40:53:~
>$ sudo systemctl status mythtv-backend
>? mythtv-backend.service - MythTV Backend
> Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
> Active: active (running) since Tue 2018-11-06 20:40:53 PST; 5s ago
> Docs: https://www.mythtv.org/wiki/Mythbackend
> Main PID: 6898 (mythbackend)
> Tasks: 8 (limit: 4915)
> CGroup: /system.slice/mythtv-backend.service
> ??6898 /usr/bin/mythbackend --quiet --syslog local7
>
>Nov 06 20:40:53 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:852 (TestDBconnection) Start up
>testing connections. DB localhost, BE , attempt 0
>Nov 06 20:40:53 Compromise mythbackend[6898]: mythbackend[6898]: I LogForward loggingserver.cpp:302 (SyslogLogger) Added syslogging
>Nov 06 20:40:54 Compromise mythbackend[6898]: mythbackend[6898]: E CoreContext mythdbcon.cpp:242 (OpenDatabase) [DBManager0]
>Unable to connect to database!
>Nov 06 20:40:54 Compromise mythbackend[6898]: mythbackend[6898]: 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)
>Nov 06 20:40:55 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:971 (TestDBconnection) Start up
>failure. host localhost, status dbStartedFail
>Nov 06 20:40:55 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:1127 (UPnPautoconf) UPNP Search 2
>secs
>Nov 06 20:40:56 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:1142 (UPnPautoconf) UPNP Search 1
>secs
>Nov 06 20:40:56 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:1142 (UPnPautoconf) UPNP Search 1
>secs
>Nov 06 20:40:56 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:1142 (UPnPautoconf) UPNP Search 1
>secs
>Nov 06 20:40:57 Compromise mythbackend[6898]: mythbackend[6898]: I CoreContext mythcontext.cpp:1152 (UPnPautoconf) No UPnP
>backends found
>20:41:07:~
>$
>
>
>mythbackend.log seems to be repeating the following over and over again:
>
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: C thread_unknown mythcommandlineparser.cpp:2619 (ConfigureLogging)
>mythbackend version: fixes/29 [v29.1-13-g329c235] www.mythtv.org
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: C thread_unknown mythcommandlineparser.cpp:2621 (ConfigureLogging) Qt
>version: compile: 5.9.4, runtime: 5.9.5
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: N thread_unknown mythcommandlineparser.cpp:2623 (ConfigureLogging)
>Enabled verbose msgs: general
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: N thread_unknown logging.cpp:927 (logStart) Setting Log Level to LOG_INFO
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I Logger logging.cpp:313 (run) Added logging to the console
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Interrupt handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Terminated handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Segmentation fault handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Aborted handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup Bus
>error handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Floating point exception handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Illegal instruction handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Real-time signal 0 handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) Setup
>Hangup handler
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: N thread_unknown mythdirs.cpp:195 (InitializeMythDirs) Using runtime
>prefix = /usr
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: N thread_unknown mythdirs.cpp:197 (InitializeMythDirs) Using
>configuration directory = /home/mythtv/.mythtv
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcorecontext.cpp:271 (Init) Assumed character
>encoding: en_US.UTF-8
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: E CoreContext mythdbparams.cpp:39 (IsValid) DBHostName is not set in
>config.xml
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: E CoreContext mythdbparams.cpp:39 (IsValid) DBHostName is not set in
>config.xml
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: N CoreContext mythcontext.cpp:599 (LoadDatabaseSettings) Empty
>LocalHostName.
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:607 (LoadDatabaseSettings) Using
>localhost value of Compromise
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:852 (TestDBconnection) Start up testing
>connections. DB localhost, BE , attempt 0, status dbAwake
>Nov 6 20:41:57 Compromise mythbackend: mythbackend[7003]: I LogForward loggingserver.cpp:302 (SyslogLogger) Added syslogging
>Nov 6 20:41:58 Compromise mythbackend: mythbackend[7003]: E CoreContext mythdbcon.cpp:242 (OpenDatabase) [DBManager0] Unable to
>connect to database!
>Nov 6 20:41:58 Compromise mythbackend: mythbackend[7003]: E CoreContext mythdbcon.cpp:243 (OpenDatabase) Driver error was
>[1/1045]:#012QMYSQL: Unable to connect#012Database error was:#012Access denied for user 'mythtv'@'localhost' (using password: YES)
>Nov 6 20:41:59 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:971 (TestDBconnection) Start up
>failure. host localhost, status dbStartedFail
>Nov 6 20:41:59 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:1127 (UPnPautoconf) UPNP Search 2 secs
>Nov 6 20:41:59 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:1142 (UPnPautoconf) UPNP Search 1 secs
>Nov 6 20:41:59 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:1142 (UPnPautoconf) UPNP Search 1 secs
>Nov 6 20:42:01 Compromise mythbackend: mythbackend[7003]: I CoreContext mythcontext.cpp:1152 (UPnPautoconf) No UPnP backends found
>Nov 6 20:42:02 Compromise mythbackend: mythbackend[7003]: C CoreContext main.cpp:132 (main) Failed to init MythContext.
>
>
>$ 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
The results of that are quite clear - mythbackend is unable to login
to the database:
>Nov 06 20:40:54 Compromise mythbackend[6898]: mythbackend[6898]: 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)
So either the config.xml that mythbackend is reading is wrong, or
MySQL does not have the correct access set up. Unfortunately
mythbackend does not log which config.xml file it is actually reading
from. Mint is based on Ubuntu, so I am going to assume that MythTV
works the same way it does on Ubuntu. The mythtv-backend.service file
seems to be identical to the Ubuntu one, and it includes the line
"User=mythtv", which means that the user will be changed from root to
mythtv before mythbackend is run. So the config.xml file it should be
reading is /home/mythtv/.mythtv/config.xml. Please check that file
has the correct setup for the database and password. If you do not
want to keep multiple copies of config.xml, then you can simply delete
or rename the one in /home/mythtv/.mythtv and add a link to the one in
/etc/mythtv:
cd /home/mythtv/.mythtv
sudo mv -v config.xml config.xml.not
sudo ln -s /etc/mythtv/config.xml
More information about the mythtv-users
mailing list