[mythtv] Systemd expertise needed: systemctl fails to start mythbackend
R. G. Newbury
newbury at mandamus.org
Thu Jul 5 21:11:32 UTC 2012
On 07/05/2012 01:22 PM, Gavin Hurlbut wrote:
> On Thu, Jul 5, 2012 at 9:25 AM, R. G. Newbury <newbury at mandamus.org> wrote:
>>
>> Which is all about the mythlogserver.....
>
> No, it is not.
>
> Read the lines more carefully.
You are correct. It mythlogserver reporting.. I should have read that
more closely.
The first logserver in the line means
> that's the process actually doing the logging. Syslog doesn't
> effectively let me shut that off. Immediately after, it shows the
> actual program the log message came from, and its pid.
OK. I rm'd the /var/log/mythtv folder and ran
[root at tor6 video]# /usr/local/bin/mythbackend --logpath /var/log/mythtv
--loglevel crit
2012-07-05 16:32:00.837126 C mythbackend version: master
[v0.26-pre-742-gb6d65fc-dirty] www.mythtv.org
2012-07-05 16:32:00.837163 C Qt version: compile: 4.8.2, runtime: 4.8.2
2012-07-05 16:32:00.837178 N Enabled verbose msgs: general
2012-07-05 16:32:36.306441 C Received Terminated
4431 pts/1 00:00:00 mythbackend
4469 ? 00:00:00 mythlogserver
4491 pts/0 00:00:00 ps
And the mythbackend log which resulted:
2012-07-05 16:32:00.837126 C [4431/4431] thread_unknown
mythcommandlineparser.cpp:2545 (ConfigureLogging) - mythbackend version:
master [v0.26-pre-742-gb6d65fc-dirty] www.mythtv.org
2012-07-05 16:32:00.837163 C [4431/4431] thread_unknown
mythcommandlineparser.cpp:2547 (ConfigureLogging) - Qt version: compile:
4.8.2, runtime: 4.8.2
2012-07-05 16:32:00.837178 N [4431/4431] thread_unknown
mythcommandlineparser.cpp:2549 (ConfigureLogging) - Enabled verbose
msgs: general
2012-07-05 16:32:36.306441 C [4431/4431] CoreContext
signalhandling.cpp:204 (handleSignal) - Received Terminated
From the time-stamp, except for the 'thread unknown' there was nothing
wrong. And this is a good operating backend And if I add an '&' to the
end of the line it goes to background and runs.
*********
And now with systemd, using ExecStart=/usr/local/bin/mythbackend
--daemon --logpath /var/log/mythtv --loglevel crit (The same command
line except for the addition of --daemon)
[root at tor6 mythtv]# systemctl start mythbackend.service
[root at tor6 mythtv]# systemctl status mythbackend.service
mythbackend.service - mythbackend daemon
Loaded: loaded (/usr/lib/systemd/system/mythbackend.service;
enabled)
Active: failed (Result: exit-code) since Thu, 05 Jul 2012
16:53:05 -0400; 1s ago
Process: 4903 ExecStart=/usr/local/bin/mythbackend --daemon
--logpath /var/log/mythtv --loglevel crit (code=exited, status=0/SUCCESS)
Main PID: 4904 (code=exited, status=130)
CGroup: name=systemd:/system/mythbackend.service
This produced NO continuing processes. The logfile has this:
2012-07-05 16:53:03.311647 C [4904/4904] thread_unknown
mythcommandlineparser.cpp:2545 (ConfigureLogging) - mythbackend version:
master [v0.26-pre-742-gb6d65fc-dirty] www.mythtv.org
2012-07-05 16:53:03.311710 C [4904/4904] thread_unknown
mythcommandlineparser.cpp:2547 (ConfigureLogging) - Qt version: compile:
4.8.2, runtime: 4.8.2
2012-07-05 16:53:03.311722 N [4904/4904] thread_unknown
mythcommandlineparser.cpp:2549 (ConfigureLogging) - Enabled verbose
msgs: general
2012-07-05 16:53:05.367814 C [4904/4904] CoreContext main.cpp:114 (main)
- Failed to init MythContext.
Which gives only one hint: the 'Failed to init MythContext', which is a
rather uninformative hint. I *think* based on this and the previous
reported error ( not seen here) that this has something to do with the
backend not being able to talk to the mysqld server.
From mythbackend/main.cpp
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init(false))
{
LOG(VB_GENERAL, LOG_CRIT, "Failed to init MythContext.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}
The LOG line is line 114. I don't know enough about the code to
understand where/what gContext= new MythContext(MYTH_BINARY_VERSION);
deals with, or why it should fail here but not when called directly...
Further ideas and hints as to how to debug this, Gavin, please!
Geoff
More information about the mythtv-dev
mailing list