[mythtv-users] Problem with wife-friendly feature
Phill Edwards
phill_edwards at hotmail.com
Wed Dec 8 11:04:33 UTC 2004
> 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
More information about the mythtv-users
mailing list