[mythtv-users] [mythtv] Could/should the shutdown command be kept locally?
Mark Knecht
markknecht at gmail.com
Tue Apr 24 01:18:40 UTC 2007
On 4/23/07, Nick Morrott <knowledgejunkie at gmail.com> wrote:
> On 24/04/07, Mark Knecht <markknecht at gmail.com> wrote:
> > On 4/22/07, Nick Morrott <knowledgejunkie at gmail.com> wrote:
>
> > > Pressing the power button on the frontend machine will gracefully shut
> > > the machine down, if you've configured your OS properly. Similarly, so
> > > will configuring a remote button to use irexec to shutdown the machine
> > > via a simple script.
> > >
> > > Nick
> >
> > Yes, I've done that much. However if you are in bed at night and
> > pretty much ready to go to sleep so you decide to shut the machine
> > down and find out it cannot communicate to the backend server then
> > getting out of bed to push the power switch is a minor inconvenience.
> > Nothing major of course. I'd even be happy with a non-Myth LIRC-based
> > solution that went around Myth completely.
> >
>
> Mark,
>
> (pulled over from -dev list)
>
> Just configure the power (or another) button on the remote to execute
> an irexec shutdown script as I alluded to before - key benefit is you
> don't need to get out of bed, and it doesn't involve MythTV at all, so
> should work even if the frontend fails to connect to the backend.
>
> Nick
Thanks Nick.
OK, based on the following link
http://www.develia.org/documents.php?l=2&f=1&p=lirclivedrive
I gave it a try by putting the following in ~mythtv/.lircrc:
#Power Button
begin
prog = irexec
button = Power
config = shutdown -h now &
end
I tried exiting mythfrontend and also tried rebooting but nothing
happened when I hit the power button on the StreamZap. It's been a
long time since I set up the StreamZap so probably I need to somehow
ensure that Power maps to the right StreamZap code. Currently I have
this in /etc/lircd.conf
<SNIP>
7 0x07
8 0x08
9 0x09
POWER 0x0A
MUTE 0x0B
CH_UP 0x0C
<SNIP>
Those came from emerging lirc with the StreamZap keyword so I hope
that's right. Everything else seems to be. There was some program for
testing StreamZap codes but I don't remember how to run it so I'll
save that for tomorrow. (or later...)
Currently the 'Stop' key is aliased to ESC so I can get to the
shutdown menu to execute shutdown, but that doesn't fix the case we
are talking about.
Thanks again for your help.
Cheers,
Mark
More information about the mythtv-users
mailing list