[mythtv] [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process

R. G. Newbury newbury at mandamus.org
Wed Jan 4 04:47:22 UTC 2012


On 01/03/2012 04:33 PM, Karl Dietz wrote:
> On 03.01.2012 18:28,  MythTV wrote:
>> #10236: Systemd Mythbackend startup does not check for existing process
>> ----------------------------------+-----------------------------
>>    Reporter:  newbury@…             |          Owner:
>>        Type:  Patch - Bug Fix       |         Status:  new
>>    Priority:  minor                 |      Milestone:  unknown
>> Component:  MythTV - General      |        Version:  Unspecified
>>    Severity:  medium                |     Resolution:
>>    Keywords:                        |  Ticket locked:  0
>> ----------------------------------+-----------------------------
>>
>> Comment (by wagnerrp):
>>
>>    Is this actually a MythTV problem?  The only two init scripts we host are
>>    ones in the Gentoo and rpm sections of the packaging repo, and neither of
>>    them seem to line up with what you're talking about.  What file needs to
>>    be changed?
>>
>
> it appears as if mythbackend needs to be changed to actually exit when
> it received the corresponding signal... ;)
>
> I have the same issue every now and then on mythbuntu 11.04 with
> master PPA
 > Karl

Yes it is a problem with MythTV. The file to be changed is pre-start.sh 
(in {$PREFIX}). The change is the addition of the 'if' stanza to kill 
any existing backend.

Re packaging: There is now a /usr/local/bin/pre-start.sh script and a 
/lib/systemd/system/mythbackend.service script which were installed as 
part of a 'configure/make/make install' cycle of a recent git master. I 
did not separately install those scripts on Fedora 16.

I presume that configure deduced that the init process is systemd and 
then calls for the appropriate scripts, choosing old-style sysv scripts 
on Fedora 14 for example. Don't know that for sure as I have never 
considered it previously, but there is no pre-start.sh script on the 
Fedora 14 mythbox at home running a mid-September git master version. I 
will look at configure and the install portion of make at work (F16) 
tomorrow.

As Karl noted, sometimes mythbackend does not actually exit and you end 
up with 2 mythbackend processes. Leftover pid files are also somewhat 
common.

Mysql's old sysv startup scripts do quite a number of things to ensure 
that mysqld will run in the proper environment. One of those things is 
checking to see if it is already running, in which case the init exits. 
(Not all of those tests are performed under systemd, unfortunately)

We want to go the other way: if a backend is already running, and a 
restart has been initiated, then we can presume that the old process is 
hung, or and should be *properly* killed. The change ensures that the 
new backend will be the ONLY backend.

In a perfect world the 'if' result  would never be needed nor executed.

Geoff









More information about the mythtv-dev mailing list