Phill Edwards wrote:
I've been trying to get the wife-friendly power button to work. I found that creating a symlink in .kde/AutoStart to irexec wasn't working for me, so I put this line in /etc/rc.local:

irexec --daemon /home/mythtv/.mythtv/lircrc

Problem is that I can't get the script to start mythfrontend. I can get it to kill it and I know the shell script is getting executed because of that and because I'm echoing some stuff to a /tmp file from it. My shell script looks like this:

#!/bin/bash
PROG=/usr/bin/mythfrontend
STATUS=`ps -e | grep mythfrontend | grep -v grep | wc -l | awk '{print $1}'`
if [ $STATUS -eq 0 ]
then
( $PROG & )
else
killall $PROG
fi
echo "mythrestart.sh executed at `date`" >> /tmp/mythrestart.log
echo "STATUS = $STATUS" >> /tmp/mythrestart.log
/usr/bin/mythfrontend
exit 0


When mythfrontend is running it correctly kills it, but when it's not running it doesn't start it up and I don' t understand why. One other point that may be relevant here is that when this gets executed mythbackend resets its idle timer which I presume means it thinks it saw a frontend connect - but where is the frontend, 'cos I can't see it?

Just posting the final solution for posterity and future searches:

You do have to run irexec as the user running X windows, so in ~/.kde/Autostart I created a file called startirexec.sh which I made executable and it looks like this:
#!/bin/bash
irexec --daemon /home/mythtv/.mythtv/lircrc


As I'd already made ~/.lircrc a symlink to ~/.mythtv/lircrc, I added the following to ~/.mythtv/lircrc:
begin
prog = irexec
button = SRS
config = /usr/local/bin/mythrestart.sh
end


mythrestart.sh looks like this (which is how it is in Jarod's guide):
#!/bin/bash
PROG=/usr/bin/mythfrontend
STATUS=`ps -e | grep mythfrontend | grep -v grep | wc -l | awk '{print $1}'`
if [ $STATUS -eq 0 ]
then
( $PROG & )
else
killall $PROG
fi
exit 0


It all works now. Thanks everyone for your help.

Regards,
Phill _______________________________________________
mythtv-users mailing list
[EMAIL PROTECTED]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to