[mythtv-users] Clean Shutdown from Frontend??

chris at cpr.homelinux.net chris at cpr.homelinux.net
Tue Aug 22 23:53:15 UTC 2006


On Tue, Aug 22, 2006 at 02:27:59PM +0100, Dave Ansell wrote:
>     When I exit the Mythfrontend with "Exit and Shutdown" the system 
> shutsdown but fails to finally switch off power.   However if I log in 
> remotely and execute "shutdown -h now" it switches off completely.
>
>     Is there any way to improve the mythfrontend shutdown command?
>
>     Secondly, is there a way to link a keystroke to a shutdown command?  (I 
> have a remote which generates keystrokes directly rather than lirc and I 
> would like to link up the power button to something useful)

Have you checked the setup screen to see what command is being 
executed?  The default MythTV installation simply puts "halt" in 
the "halt command" field.  You would have to edit that field to say 
"sudo shutdown -h now" and configure sudo to allow your frontend 
login to execute that command.

The /etc/inittab file allows you to specify a few special commands.

Here's a sample:

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

If you can find a way to get the remote control to generate an 
ALT-UpArrow keypress then you could edit inittab to do a shutdown 
when it gets a kbrequest.  The other solution would be to find a 
way to convert some other keypress into a powerfailnow signal.



More information about the mythtv-users mailing list