[mythtv-users] CTRL-ALT-BACKSPACE -> multiple instances of mythfrontend

Allen Edwards allen.p.edwards at gmail.com
Sun Mar 10 16:50:51 UTC 2019


Hi Ian and Stephen,

You guys were busy as I slept so I am creating a single response.

As to what I am running this is what I know

*dad at NewMyth:~$ lsb_release -a*
*No LSB modules are available.*
*Distributor ID: Ubuntu*
*Description:    Ubuntu 16.04.1 LTS*
*Release:        16.04*
*Codename:       xenial*


*dad at NewMyth:~$ apt-cache policy mythtv*
*mythtv:*
*  Installed: 2:0.28.2+fixes.20180827.9031599-0ubuntu0mythbuntu2*
*  Candidate: 2:0.28.2+fixes.20180827.9031599-0ubuntu0mythbuntu2*
*  Version table:*
* *** 2:0.28.2+fixes.20180827.9031599-0ubuntu0mythbuntu2 500*
*        500 http://ppa.launchpad.net/mythbuntu/0.28/ubuntu
<http://ppa.launchpad.net/mythbuntu/0.28/ubuntu> xenial/main i386 Packages*
*        100 /var/lib/dpkg/status*
*     2:0.28.0+fixes.20160413.15cf421-0ubuntu2 500*
*        500 http://us.archive.ubuntu.com/ubuntu
<http://us.archive.ubuntu.com/ubuntu> xenial/multiverse i386 Packages*


And to Ian's question:

*dad at NewMyth:~$ ls -la /home/dad/.config/autostart*
*total 16*
*drwxrwxr-x  2 dad dad 4096 Oct 14 09:22 .*
*drwxrwxr-x 12 dad dad 4096 Feb 24 17:14 ..*
*lrwxrwxrwx  1 dad dad   38 Aug 25  2018 mythtv.desktop ->
/usr/share/applications/mythtv.desktop*
*-rw-rw-r--  1 dad dad   30 Oct 14 09:19 pulseaudio.desktop*
*-rw-rw-r--  1 dad dad   29 Oct 14 09:22 xfsettingsd.desktop*


I must say, I did think your solution of killing mythfrontend via the
remote to be a good and elegant one.  Given that a remote is nearly always
to hand, it's about as user-friendly as it could be.  So far, we have gone
down this rabbit hole a bit - the question now is whether to go further
down it or give up...

For a number of reasons having to do with what we are used to, the
difficulty of programming and using the remote, and the unknowns of
changing the lirc code, I prefer to continue on the CTRL-ALT-BS question as
I think we are very close to a solution with all the thought you two have
put into this. It could also be of benefit to others if a good solution is
found.

ultimately suggest running mythfrontend without the --service option

If Myth is being run by that script from 2007 that doesn't even run
correctly I must ask does myth still crash often enough that the auto
restart is necessary?  This seems like a super easy solution unless the
underlying program crashes constantly. BTW, I tested it and it works.

Of course, I may not know if this script is restarting myth but I doubt it
as we can see that it does't work.  The crashes I get of myth are freeze
up.  Still possible I would not know but worth thought as if the script
really is 12 years old then perhaps it is solving a problem that is no
longer a problem.

Clicking on the Edit button reveals that this runs:
*  mythfrontend --service*

Correct. What is your opinion on how important the --service is at this
point? That script is really old if the comments are correct.

If the --service option is necessary am I correct that the suggestion is to
change this line

*pidof mythfrontend.real 2>&1 >/dev/null && wmctrl -a "MythTV Frontend"
2>/dev/null && exit 0*

To this

*pidof mythfrontend.real 2>&1 >/dev/null*
*pidof_retcode=$?*
*if [ $pidof_retcode==0 ]; then*
*  wmctrl -a "MythTV Frontend" 2>/dev/null*
*  wmctrl_retcode=$?*
*else*
*  wmctrl_retcode=1*
*fi*
*if [ pidof_retcode==0 || wmctrl_retcode==0 ]; then*
*  exit 0*
*fi*

By the way, *pidof mythfrontend.real *returns 3524 (the pid) and *wmctrl -a
"MythTV Frontend"  *doesn't return anything at least on a terminal but I
think that is normal.

What I think is going on is that X closes mythfrontend.real but does not
close the service.  Then when X opens again and checks if myth is running
the service has not had time to get its version of myth running so the pid
returns null or 0. This happens so fast and all the services start versions
of myth before the pid is valid. One key is that when I do CTRL-ALT-BS I
don't always get a new instance, just 80-90% of the time.  This says to me
there is a timing component to the problem.  My computer is much faster
with the new RAM and my guess is that mostly all the services are busy
starting an instance of myth before a pid is established. Perhaps what is
needed as the first line of the script is a delay.

I will test the proposed script changes when I hear from you that I
understand it correctly and continue to think it is a good idea. Until
then, I am running mythfrontend without the service option. My gut says
that is the best solution anyway.   That script is just too old. I don't
trust it and doubt that it is necessary any longer.

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20190310/31c7baad/attachment.html>


More information about the mythtv-users mailing list