[mythtv-users] Double invocations of mythfrontend

Dag Nygren dag at newtech.fi
Sun Dec 18 11:01:47 EST 2005


Hi again,

I have one problem here, where I wonder if anyone out
there could help.

I have a small script that restarts mythfrontend when it crashes,
looks like this:
#!/bin/sh
LOGFILE=/home/mythtv/mythstarter.log
while true
do
        ps -e | grep -q mythfrontend
        if [ $? -eq 0 ]
        then
                date >>$LOGFILE
                echo "Sleeping 2 seconds" >>$LOGFILE
                sleep 2
                true
        else
                date >>$LOGFILE
                echo "Starting mythfrontend" >>$LOGFILE
#               mythfrontend
                mythfrontend -l /var/log/mythfront.log
                date >>$LOGFILE
                echo "mythfrontend ended" >>$LOGFILE
        fi
        if [ -f /home/mythtv/mythquit ]
        then
                exit 0
        fi
done

The problem I have is that something seems to invoke more mythfrontend 
processes
and it doesn't seem to be my script. This new mythfrontend occasionally steals 
the focus of the
process in use.
The extra process has a parent PID of 1.
Is mythfrontend forking at some point?

This is probably not a myth problem, but any hint would help.

I can add that I am not new to UNIX and Linux, have been doing UNIX since 1980 
and Linux since
1994, but I am really having problems with this.

Best
Dag



More information about the mythtv-users mailing list