Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

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

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


dekarl at spaetfruehstuecken

Jan 3, 2012, 1:33 PM

Post #1 of 11 (890 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process

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

Regards,
Karl
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


newbury at mandamus

Jan 3, 2012, 8:47 PM

Post #2 of 11 (875 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

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







_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


robert.mcnamara at gmail

Jan 3, 2012, 8:55 PM

Post #3 of 11 (880 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On Tue, Jan 3, 2012 at 8:47 PM, R. G. Newbury <newbury [at] mandamus> wrote:

> 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.
>

There are no such files in any of MythTV's repositories. Wherever these
came from for you, it wasn't our code.

Robert


newbury at mandamus

Jan 4, 2012, 8:00 AM

Post #4 of 11 (865 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On 01/03/2012 11:55 PM, Robert McNamara wrote:
> On Tue, Jan 3, 2012 at 8:47 PM, R. G. Newbury<newbury [at] mandamus> wrote:
>
>> 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.
>>
>
> There are no such files in any of MythTV's repositories. Wherever these
> came from for you, it wasn't our code.
>
> Robert

I stand corrected.

I can now only assume that those scripts are part of a standard Fedora
16 install and are provided by Fedora/RedHat.

Is it true then, that in the past, the /etc/rc.d/init.d/mythbackend
script on a Fedora 14 install (for example) did NOT come from the Mythtv
repos?

(I note that I have never used atrpms or rpmfusion as repo sources for
the mythtv suite).

I makes sense that RedHat might do that, and more thanks to them.

I will try to find some time and create a clean F16 install as a virtual
guest and examine the entrails for auguries of the past!

If true then the 'fix' is to inserted elsewhere.

Geoff

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


hobbes1069 at gmail

Jan 4, 2012, 8:04 AM

Post #5 of 11 (870 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On Wed, Jan 4, 2012 at 10:00 AM, R. G. Newbury <newbury [at] mandamus> wrote:
> On 01/03/2012 11:55 PM, Robert McNamara wrote:
>> On Tue, Jan 3, 2012 at 8:47 PM, R. G. Newbury<newbury [at] mandamus> wrote:
>>
>>> 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.
>>>
>>
>> There are no such files in any of MythTV's repositories. Wherever these
>> came from for you, it wasn't our code.
>>
>> Robert
>
> I stand corrected.
>
> I can now only assume that those scripts are part of a standard Fedora
> 16 install and are provided by Fedora/RedHat.
>
> Is it true then, that in the past, the /etc/rc.d/init.d/mythbackend
> script on a Fedora 14 install (for example) did NOT come from the Mythtv
> repos?

Yes, at least for RPM Fusion, the sysv init script (and as of Fedora
16, the systemd service file) are provided by the package, not from
upstream.

Richard
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


newbury at mandamus

Jan 4, 2012, 8:58 AM

Post #6 of 11 (861 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On 01/04/2012 11:04 AM, Richard Shaw wrote:
> On Wed, Jan 4, 2012 at 10:00 AM, R. G. Newbury<newbury [at] mandamus> wrote:
>> On 01/03/2012 11:55 PM, Robert McNamara wrote:
>>> On Tue, Jan 3, 2012 at 8:47 PM, R. G. Newbury<newbury [at] mandamus> wrote:
>>>
>>>> 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.
>>>>
>>>
>>> There are no such files in any of MythTV's repositories. Wherever these
>>> came from for you, it wasn't our code.
>>>
>>> Robert
>>
>> I stand corrected.
>>
>> I can now only assume that those scripts are part of a standard Fedora
>> 16 install and are provided by Fedora/RedHat.
>>
>> Is it true then, that in the past, the /etc/rc.d/init.d/mythbackend
>> script on a Fedora 14 install (for example) did NOT come from the Mythtv
>> repos?
>
> Yes, at least for RPM Fusion, the sysv init script (and as of Fedora
> 16, the systemd service file) are provided by the package, not from
> upstream.
>
> Richard

Just to be clear, are you saying that those files are provided by the
rpmfusion packager and NOT by Fedora?

In which case, where did mine come from??? As noted, I have never used
atrpms or rpmfusion for myth...

Geoff

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


hobbes1069 at gmail

Jan 4, 2012, 9:01 AM

Post #7 of 11 (863 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On Wed, Jan 4, 2012 at 10:58 AM, R. G. Newbury <newbury [at] mandamus> wrote:
> On 01/04/2012 11:04 AM, Richard Shaw wrote:
>> Yes, at least for RPM Fusion, the sysv init script (and as of Fedora
>> 16, the systemd service file) are provided by the package, not from
>> upstream.
>>
>> Richard
>
> Just to be clear, are you saying that those files are provided by the
> rpmfusion packager and NOT by Fedora?

Well, either way they would not be provided by Fedora since MythTV is
not eligible to live within Fedora, but yes, they are provided by the
packager.


> In which case, where did mine come from??? As noted, I have never used
> atrpms or rpmfusion for myth...

Hmm.. not sure. Could you have followed some wiki/instructions some
time ago that had you create (or download) one?

Richard
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


newbury at mandamus

Jan 4, 2012, 7:38 PM

Post #8 of 11 (855 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On 01/04/2012 12:01 PM, Richard Shaw wrote:
> On Wed, Jan 4, 2012 at 10:58 AM, R. G. Newbury<newbury [at] mandamus> wrote:
>> On 01/04/2012 11:04 AM, Richard Shaw wrote:
>>> Yes, at least for RPM Fusion, the sysv init script (and as of Fedora
>>> 16, the systemd service file) are provided by the package, not from
>>> upstream.
>>>
>>> Richard
>>
>> Just to be clear, are you saying that those files are provided by the
>> rpmfusion packager and NOT by Fedora?
>
> Well, either way they would not be provided by Fedora since MythTV is
> not eligible to live within Fedora, but yes, they are provided by the
> packager.
>
>
>> In which case, where did mine come from??? As noted, I have never used
>> atrpms or rpmfusion for myth...
>
> Hmm.. not sure. Could you have followed some wiki/instructions some
> time ago that had you create (or download) one?
>
> Richard

Now that I have taken a look at the mythbox, I remember that there were
files provided in the 'contrib' folder which were to be copied to
/etc/sysconfig and /etc/rc.d/init.d for mythbackend. There were versions
for both fedora and ubuntu. These extras have disappeared from the
master download...

Which leaves us no further ahead at this point. Thanks for jogging my
memory.

Geoff






_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


dekarl at spaetfruehstuecken

Jan 5, 2012, 3:16 PM

Post #9 of 11 (841 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On 03.01.2012 22:33, 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

here's a backtrace http://paste.ubuntu.com/794362/
mythbackend is keeping one cpu busy at that point in time and the
recordings view in mythweb shows one recording from yesterday as still
running, but no recorder is in use...

MythTV Version: v0.25pre-3937-g0297b3a => December 23rd, time to update?
MythTV Branch : master

Regards,
Karl
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


newbury at mandamus

Jan 5, 2012, 5:20 PM

Post #10 of 11 (840 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

On 01/05/2012 06:16 PM, Karl Dietz wrote:
> On 03.01.2012 22:33, 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
>
> here's a backtrace http://paste.ubuntu.com/794362/
> mythbackend is keeping one cpu busy at that point in time and the
> recordings view in mythweb shows one recording from yesterday as still
> running, but no recorder is in use...

The backtrace might provide some insight into what has gone wrong.
Amending the pre-start.sh script will at least kill the zombie process,
easily, But given your symptoms, you might not realize that things had
gone wrong, without some amount of checking.
Geoff
--


_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev


hobbes1069 at gmail

Jan 5, 2012, 5:28 PM

Post #11 of 11 (837 views)
Permalink
Re: [mythtv-commits] Ticket #10236: Systemd Mythbackend startup does not check for existing process [In reply to]

Can you provide a copy of the full mythbackend.service file? I didn't
use that comment for the RPM Fusion service file and it may not be
necessary.

After several iterations we ended up with Type=simple. That way you
don't have to worry about a PID file. Systemd will take care of it and
kill it when you run systemctl stop mythbackend.service.

Other than one reported instance of mythbackend trying to connect to
mysql before it was ready to accept connections, which is either a
systemd or mysql bug, it's worked quite well.

Richard

Here's the full unit file:
[Unit]
Description=MythTV backend service
After=network.target mysqld.service

[Service]
Type=simple
Environment=MYTHCONFDIR=/etc/mythtv
Environment=HOME=/usr/share/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --logfile /var/log/mythtv/mythbackend.log

[Install]
WantedBy=multi-user.target
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.