[mythtv-users] Problem with wife-friendly feature

John Harvey john.p.harvey at btinternet.com
Tue Dec 7 09:22:15 UTC 2004


 --- Phill Edwards <phill_edwards at hotmail.com> 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?
> >
> >
> > do a /usr/bin/mythfrontend >somelog
> >
> > or even (for stderr)
> > /usr/bin/mythfrontend 2>&1 >somelog
> >
> > My bet is that is is not running in X so it won't
> open up the file.  Try
> > setting the display
> > export DISPLAY=0:0
> > you may need to have xhost set correctly.
> 
> I think you're right. When I run
> /usr/bin/mythfrontend from the command line
> I get an error that says "Couldn't connect to X
> server".  But if I then do
> "export DISPLAY=0:0" and run it I get this error:
> 
> _X11TransSocketINETConnect() can't get address for
> 0:6000: Name or service
> not known
> mythfrontend: cannot connect to X server 0:0
> 
> I'm out of my depth here - I have no idea what that
> means and I don't
> understand what having xhost set correctly means. I
> thought this would be so
> incredibly simple, but it's proving very difficult.
> Surely there's an easy
> way to do this?
> 
> Regards,
> Phill
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>  

Do
export DISPLAY=:0

0:0 says use display 0 on the machine 0 which isnt a
valid machine name.

:0 says use display 0 on the current machine.
Alternatively 

export DISPLAY=localhost:0

should also work.

John


More information about the mythtv-users mailing list