[mythtv-users] Multiple (duplicate) instances of mythfrontend

Larry K lunchtimelarry at gmail.com
Sun May 8 18:01:40 UTC 2005


Hello,

I have been struggling with this issue for a couple of weeks, with no 
resolution. A search of this forum finds similar issues surrounding vnc, but 
none that seem to be like mine. 

I am using an lirc script to start/stop mythfrontend. The idea is that the 
remote control power button will kill off the frontend if it is running, and 
to restart the frontend if it is not running. Problem is, when I restart the 
frontend, I sometimes (but not always) get two instances of the frontend, 
and this causes conflicts with sound, among other things. It's easy enough 
for me to shell in to the box and kill one of them off, but my wife will not 
be too thrilled about doing that for herself, so I think I better find a 
better solution.

Here is my script:

[mythtv at localhost ~]$ more /usr/local/bin/mythpowerbutton.sh
#!/bin/bash
PROG=mythfrontend
OPTION=`--verbose`
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`
if [ $STATUS -eq 0 ]
then
( $PROG $OPTION >> /var/log/mythtv/front.log & )
else
killall $PROG
fi
exit 0
[mythtv at localhost ~]$


This script is invoked from the .lircrc config file as so:

# Power Off/Exit
begin
prog = irexec
button = OFF
config = /usr/local/bin/mythpowerbutton.sh
end

Can anyone offer a suggestion to how I can solve this annoyance?
Larry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20050508/5f26ec2c/attachment.htm


More information about the mythtv-users mailing list