LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Containers (https://www.linuxquestions.org/questions/linux-containers-122/)
-   -   Mythtv Backend in Docker. Trouble with starting service. (https://www.linuxquestions.org/questions/linux-containers-122/mythtv-backend-in-docker-trouble-with-starting-service-4175687427/)

jmgibson1981 12-24-2020 07:56 AM

Mythtv Backend in Docker. Trouble with starting service.
 
Got it into a Docker, mostly. One problem is remaining though.

When the container starts and runs my entrypoint.sh it does everything except start the myth backend itself. All configuration, and the other services are started properly. If I enter the container to run the command manually.

Code:

service mythtv-backend start
It tells me the it's already running. If I try to stop it it says there is no process. It also isn't showing up on the top command inside the container. If I run

Code:

service mythtv-backend restart
It first complains that the service isn't running. Then it starts and away it goes like it's supposed to.

I'm probably not doing my entrypoint correctly. Here are my entrypoint & Dockerfile. Posting via ubuntupaste. I'm sure my service && bash is the wrong way to do it. It's worked on my other services thus far. I added that sleep thinking maybe it just needed to wait till the sql was fully running or something.

Dockerfile - https://paste.ubuntu.com/p/mpCnV3dBMv/
Entrypoint - https://paste.ubuntu.com/p/jDDSNFStCZ/

I'd appreciate any suggestions.

berndbausch 12-24-2020 09:06 AM

Have you tried using systemctl instead of service?

I'd be interested in the output of
Code:

systemctl status mythtv-backend
systemctl start mythtv-backend
systemctl stop mythtv-backend

Also, I don't know where Mythtv's log files are, but it must have some. Perhaps the systemd journal. I would find out where they are and check for error messages. Furthermore, you can add set -x to your entrypoint script; it will show you each step that the script goes through. You can probably see its output by docker logs <CONTAINER-ID>.

jmgibson1981 12-29-2020 09:09 AM

Sorry, took a few days. The reason I don't use Systemd is it is not normally used in Docker containers. I did however rebuild with rsyslog. Here is where the problem seems to be, rather the only Errors in the log.

Code:

Dec 29 15:04:32 mythsql mysqld: 2020-12-29 15:04:32 50 [ERROR] mysqld: Table './mythconverg/tvchain' is marked as crashed and should be repaired
Dec 29 15:04:32 mythsql mysqld: 2020-12-29 15:04:32 50 [Warning] Checking table:  './mythconverg/tvchain'
Dec 29 15:04:32 mythsql mysqld: 2020-12-29 15:04:32 80 [ERROR] mysqld: Table './mythconverg/oldprogram' is marked as crashed and should be repaired
Dec 29 15:04:32 mythsql mysqld: 2020-12-29 15:04:32 80 [Warning] Checking table:  './mythconverg/oldprogram'

Going to look into having a repair run before starting the myth backend.

jmgibson1981 01-19-2021 04:55 AM

So I was way off on the error above. That turns out to be meaningless near as I can tell. I did however find the issue with the pid file not being removed on container stop. Existing pid file means failed restart requiring a manual service restart. Added this line to my entrypoint before the service start.

Code:

[ -f /run/mythtv/mythbackend.pid ] && rm /run/mythtv/mythbackend.pid
Have stopped and started several times now without issue.


All times are GMT -5. The time now is 07:28 PM.