[mythtv-users] Re: Double invocations of mythfrontend

Joe Ammann joe at pyx.ch
Sat Dec 24 08:56:54 EST 2005


On Sunday 18 December 2005 20:37, Dag Nygren wrote:
> > Dag Nygren wrote:
> > > The extra process has a parent PID of 1.
> >
> > PID 1 is the init process. Check your /etc/inittab for mythfrontend
> > entries with the "respawn" flag.
>
> Thanks, but that would be too easy ;-)
>
> PID 1 is also the process that inherits all processes where the parent
> has died, and I think this is what happens. Just have to figure  out how
> it happens.

Just went through the same problem. I had my "restartfronted" script attached 
to a specific button on my remote via irexec daemon. It used to work for some 
time, but then suddenly when I used it, it started 3 or 4 copies of the 
frontend. I guess this must have been caused by one of the regular upgrades 
of lirc or something.

Anyway, I found out that the script was really started several times for some 
reason, so I just made sure that the script won't run in parallel

#!/bin/bash

mkdir /tmp/restartfrontend || exit 0
trap 'rmdir /tmp/restartfrontend 2>/dev/null' EXIT

pkill mythfrontend
sleep 2
pkill -9 mythfrontend
nohup mythfrontend >> $HOME/.xsession-errors 2>&1 &
sleep 5
rmdir /tmp/restartfrontend

Works for me!

CU, Joe


More information about the mythtv-users mailing list