multiple instances on one box undesirable

Bug #352077 reported by Andrew Roazen on 2009-03-31
6
Affects Status Importance Assigned to Milestone
Mythbuntu
Fix Released
Wishlist
Unassigned
mythtv (Ubuntu)
Undecided
Unassigned

Bug Description

MythTV does not restrict the number of instances of mythfrontend which can run simultaneously on the same box. There is no particular reason why one box should run multiple instances simultaneously and this can inadvertently lead to symptoms like the sound disappearing and performance degradation.

The script or binary which mythfrontend runs should first check to see if the process already exists and refuse to continue if it does.

Version installed: 0.21.0+fixes18722-0ubuntu1
OS Description: Ubuntu 8.10 (Release: 8.10)

Because MythTV is typically installed on a desktop OS, it is possible for users to inadvertently trigger multiple instances; some report this happening because of scripts associated with remote buttons. Rather than fix button scripts, the process should monitor itself -- unless there's some reason why it would be desirable for a single box to run multiple instances of the frontend. Again, I'm not talking about preventing multiple frontends running on multiple boxes, just limiting each box to one instance each of the frontend.

Related branches

Hi Andrew:

I think this is a good idea, if you can write a patch for the mythfrontend
startup script, that would be even better. It's in sh, and located at
/usr/bin/mythfrontend . We'd be glad to integrate it then.

On Mon, Mar 30, 2009 at 20:23, Andrew Roazen <email address hidden> wrote:

> Public bug reported:
>
> MythTV does not restrict the number of instances of mythfrontend which
> can run simultaneously on the same box. There is no particular reason
> why one box should run multiple instances simultaneously and this can
> inadvertently lead to symptoms like the sound disappearing and
> performance degradation.
>
> The script or binary which mythfrontend runs should first check to see
> if the process already exists and refuse to continue if it does.
>
> Version installed: 0.21.0+fixes18722-0ubuntu1
> OS Description: Ubuntu 8.10 (Release: 8.10)
>
> Because MythTV is typically installed on a desktop OS, it is possible
> for users to inadvertently trigger multiple instances; some report this
> happening because of scripts associated with remote buttons. Rather than
> fix button scripts, the process should monitor itself -- unless there's
> some reason why it would be desirable for a single box to run multiple
> instances of the frontend. Again, I'm not talking about preventing
> multiple frontends running on multiple boxes, just limiting each box to
> one instance each of the frontend.
>
> ** Affects: mythtv (Ubuntu)
> Importance: Undecided
> Status: New
>
> --
> multiple instances on one box undesirable
> https://bugs.launchpad.net/bugs/352077
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is subscribed to mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>
Sent from: Austin Texas United States.

Andrew Roazen (andrew-roazen) wrote :

I think fundydan's approach linked here is what I was talking about:
http://ubuntuforums.org/showpost.php?p=6305480&postcount=11

If you still require me to write the patch myself I'll do it; I'm at work and can't do it right now.

I suspect multiple instances being accidentally triggered are what's behind the number of backend crashes I've been experiencing on and off over the last few months.

On 3/31/09 7:44 AM, "Mario Limonciello" <email address hidden> wrote:

Hi Andrew:

I think this is a good idea, if you can write a patch for the mythfrontend
startup script, that would be even better. It's in sh, and located at
/usr/bin/mythfrontend . We'd be glad to integrate it then.

On Mon, Mar 30, 2009 at 20:23, Andrew Roazen <email address hidden>
wrote:

> Public bug reported:
>
> MythTV does not restrict the number of instances of mythfrontend which
> can run simultaneously on the same box. There is no particular reason
> why one box should run multiple instances simultaneously and this can
> inadvertently lead to symptoms like the sound disappearing and
> performance degradation.
>
> The script or binary which mythfrontend runs should first check to see
> if the process already exists and refuse to continue if it does.
>
> Version installed: 0.21.0+fixes18722-0ubuntu1
> OS Description: Ubuntu 8.10 (Release: 8.10)
>
> Because MythTV is typically installed on a desktop OS, it is possible
> for users to inadvertently trigger multiple instances; some report this
> happening because of scripts associated with remote buttons. Rather than
> fix button scripts, the process should monitor itself -- unless there's
> some reason why it would be desirable for a single box to run multiple
> instances of the frontend. Again, I'm not talking about preventing
> multiple frontends running on multiple boxes, just limiting each box to
> one instance each of the frontend.
>
> ** Affects: mythtv (Ubuntu)
> Importance: Undecided
> Status: New
>
> --
> multiple instances on one box undesirable
> https://bugs.launchpad.net/bugs/352077
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is subscribed to mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>
Sent from: Austin Texas United States.

--
multiple instances on one box undesirable
https://bugs.launchpad.net/bugs/352077
You received this bug notification because you are a direct subscriber
of the bug.

Mario Limonciello (superm1) wrote :
Download full text (3.1 KiB)

I'd prefer that existing processes don't get killed, but instead if other
processes are running, just output something saying 'not starting because
...'

If you can write the patch, that would still be better. Take your time with
it when you get a chance.

On Tue, Mar 31, 2009 at 16:50, Andrew Roazen <email address hidden> wrote:

> I think fundydan's approach linked here is what I was talking about:
> http://ubuntuforums.org/showpost.php?p=6305480&postcount=11
>
> If you still require me to write the patch myself I'll do it; I'm at
> work and can't do it right now.
>
> I suspect multiple instances being accidentally triggered are what's
> behind the number of backend crashes I've been experiencing on and off
> over the last few months.
>
> On 3/31/09 7:44 AM, "Mario Limonciello" <email address hidden> wrote:
>
> Hi Andrew:
>
> I think this is a good idea, if you can write a patch for the mythfrontend
> startup script, that would be even better. It's in sh, and located at
> /usr/bin/mythfrontend . We'd be glad to integrate it then.
>
> On Mon, Mar 30, 2009 at 20:23, Andrew Roazen <email address hidden>
> wrote:
>
> > Public bug reported:
> >
> > MythTV does not restrict the number of instances of mythfrontend which
> > can run simultaneously on the same box. There is no particular reason
> > why one box should run multiple instances simultaneously and this can
> > inadvertently lead to symptoms like the sound disappearing and
> > performance degradation.
> >
> > The script or binary which mythfrontend runs should first check to see
> > if the process already exists and refuse to continue if it does.
> >
> > Version installed: 0.21.0+fixes18722-0ubuntu1
> > OS Description: Ubuntu 8.10 (Release: 8.10)
> >
> > Because MythTV is typically installed on a desktop OS, it is possible
> > for users to inadvertently trigger multiple instances; some report this
> > happening because of scripts associated with remote buttons. Rather than
> > fix button scripts, the process should monitor itself -- unless there's
> > some reason why it would be desirable for a single box to run multiple
> > instances of the frontend. Again, I'm not talking about preventing
> > multiple frontends running on multiple boxes, just limiting each box to
> > one instance each of the frontend.
> >
> > ** Affects: mythtv (Ubuntu)
> > Importance: Undecided
> > Status: New
> >
> > --
> > multiple instances on one box undesirable
> > https://bugs.launchpad.net/bugs/352077
> > You received this bug notification because you are a member of MythTV
> > Ubuntu Maintainers, which is subscribed to mythtv in ubuntu.
> >
>
>
> --
> Mario Limonciello
> <email address hidden>
> Sent from: Austin Texas United States.
>
> --
> multiple instances on one box undesirable
> https://bugs.launchpad.net/bugs/352077
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> --
> multiple instances on one box undesirable
> https://bugs.launchpad.net/bugs/352077
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is subscribed to mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>
Sent from New York, United ...

Read more...

MarcRandolph (mrand) wrote :

Upstream won't make a change like this without a patch. Moving to mythbuntu where it can be tracked for the script(s).

Changed in mythbuntu:
importance: Undecided → Wishlist
status: New → Confirmed
Changed in mythtv (Ubuntu):
status: New → Invalid
Gary Butters (gbutters) wrote :

Here is a patch for this

It depends on wmctrl

--- mythfrontend.sh.orig 2009-10-06 03:54:43.000000000 -0500
+++ mythfrontend.sh 2009-10-10 22:33:30.322126832 -0500
@@ -2,6 +2,8 @@
 # Mario Limonciello, March 2007
 # partially merged with startmythtv.sh by Michael Haas, October 2007

+pidof mythfrontend.real 2>/dev/null && wmctrl -a "MythTV Frontend" 2>/dev/null && exit
+
 #source our dialog functions
 . /usr/share/mythtv/dialog_functions.sh

Mario Limonciello (superm1) wrote :

Thanks for the fix!

This is a significant step in the right direction albeit still not perfect.

This fix is on the trunk bzr tree, revno 215. It will be in the next upload as well as daily builds from Oct 11 and later.

Changed in mythtv (Ubuntu):
status: Invalid → Fix Committed
Changed in mythbuntu:
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mythtv - 0.22.0~trunk22413-0ubuntu1

---------------
mythtv (0.22.0~trunk22413-0ubuntu1) karmic; urgency=low

  [ Gary Butters ]
  * debian/control:
    - Depends on wmctrl
  * Add support to use wmctrl to bring mythfrontend to the foreground
    if already running. (LP: #352077)

  [ Mario Limonciello ]
  * New upstream snapshot (r22413)
  * Add a bug_pattern_base to the mythbuntu crashdb.
  * Fix mythbuntu crashdb to refer to project not product.
  * Simplify the apport hook so that we can catch on any set of non
    distro packages.
  * debian/rules:
    - Make *sure* /etc/default/mythtv-backend is getting installed.
      It seems that dh_installinit didn't want to install it when we use upstart.

 -- Mario Limonciello <email address hidden> Mon, 12 Oct 2009 17:13:20 -0500

Changed in mythtv (Ubuntu):
status: Fix Committed → Fix Released
Tim (leprasmurf) wrote :

I applied the patch, and my issue was recurring. I upgraded all packages, and still it recurred. Perhaps I'm experiencing a separate issue, but my fix was a simple script and to try and change all calls from mythfrontend.real to mythfrontend.real.sh.

#!/bin/bash

MYTHPID=`pidof mythfrontend.real`

echo $MYTHPID

if [ -z "$MYTHPID" ]
then
 /usr/bin/mythfrontend.real
elif [[ "$MYTHPID" =~ " " ]]
then
 echo "multiple instances running";
 kill `pidof mythfrontend.real|awk '{print $2}'`
else
 echo "There is already an instance of Mythfrontend running.";
fi

MarcRandolph (mrand) wrote :

Gary Butters patch was applied in time for the -rc.

Changed in mythbuntu:
status: Fix Committed → Fix Released
Dave Pusey (davepusey) wrote :

I have a genuine need to run multiple frontend processes on my computer. This worked find under 0.21, but since upgrading to 0.22 i cannot do this. I suspect this bug fix is what is preventing me from doing it. Is there a way to override this restriction?

Dave Pusey (davepusey) wrote :

Following up on my previous comment, i have removed the patch from my mythfrontend.sh file, but a command line switch to override this feature for those like myself who need multiple processes would be a good idea.

At the time i submitted the bug report I think I was careful to say I couldn't think of a situation where it would be desirable to have multiple frontends running on one machine. I'm intrigued as to what you're doing with multiple frontends.

On Feb 22, 2010, at 3:00 PM, Dave Pusey wrote:

> Following up on my previous comment, i have removed the patch from my
> mythfrontend.sh file, but a command line switch to override this feature
> for those like myself who need multiple processes would be a good idea.

Dave Pusey (davepusey) wrote :

I use two frontends when watching the Formula 1.

I have a large one for the main feed, And a smaller one without sound at the side for the onboards feed.

Andrew Roazen (andrew-roazen) wrote :

This is what PiP was invented for<http://en.wikipedia.org/wiki/Picture-in-picture>. Specifically. Myth even lets you switch back and forth which video/audio is outermost (like most commercial solutions).

Perhaps a preference could be added to Myth's config screens to allow multiple frontends for edge cases like yours (and have this patch check for that preference), but it should not be on by default.

On Feb 24, 2010, at 5:48 AM, Dave Pusey wrote:

I use two frontends when watching the Formula 1.

I have a large one for the main feed, And a smaller one without sound at the side for the onboards feed.

Dave Pusey (davepusey) wrote :

I tried PIP, but didn't won't the other feed obscuring part of the main feed.

My suggestion would be to have a command-line switch like --allow-multiple that would bypass the check if used.

Andrew Roazen (andrew-roazen) wrote :

I have no problem with this.

On Feb 26, 2010, at 7:09 AM, Dave Pusey wrote:

> My suggestion would be to have a command-line switch like --allow-multiple that would bypass the check if used.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers