[vdr] [ANNOUNCE] VDR Power Button Daemon 0.0.1

Sebastian Frei sebastian at familie-frei.net
Fri Mar 29 10:07:38 CET 2013


Hello,

I don't want to hijack your thread, but just as a reference here is my solution with acpid to achieve nearly the same:


/etc/acpid/power:

event=button/power*
action=/sbin/acpishutdown.sh



/sbin/acpishutdown.sh:

#!/bin/sh
if [ -e /tmp/acpibutton ]; then
  if [ `/bin/ls /tmp/acpibutton -lc --time-style="+%s"|/bin/cut --delemiter=" " --fields 6` -gt `/bin/date --date="20 seconds ago" +%s` ]; then
    /sbin/shutdown -h now
  else
    /bin/touch /tmp/acpibutton
    /bin/svdrpsend HITK Power
  fi
else
  /bin/touch /tmp/acpibutton
  /bin/svdrpsend HITK Power
fi



If you press the power button VDR is told via SVDRP to shut down.
If you press the power button two times within 20 seconds, the computer is shutdown directly with /sbin/shutdown.

Best regards
Sebastian

Am Mittwoch, 27. März 2013, 18:44:28 schrieb Manuel Reimer:
> Hello List,
> 
> I have written a small daemon, which can replace acpid on VDR systems and
> was written with dedicated VDR systems in mind.
> 
> Core Features:
> - Faster than acpid with all the required external scripts.
> - Emergency reboot feature. You don't loose the power button as safe
> emergency exit button. Just press it four times within three seconds and a
> clean reboot is triggered.
> - Very easy to set up. If you want, you can just copy the "vdrpbd" file to
> your VDR system and execute it. VDR should react to the power button
> immediately! - Systemd integration. If systemd is detected, then vdrpbd
> tries to register itself as "power button inhibitor". The module
> "Net::DBus" is required for this to work.
> 
> Note that it requires an up-to-date kernel, as the only supported way, to
> access the power button, is the input layer. There is no "netlink" support
> and I also won't add it.
> 
> Download from here:
> http://projects.vdr-developer.org/attachments/download/1331/vdrpbd-0.0.1.tar
> .xz
> 
> To post bug reports and feature requests, you may use the ticket system
> here: http://projects.vdr-developer.org/projects/vdrpbd/issues/new
> 
> Or just answer to this mail and tell me about your opinion and/or give
> feature requests.
> 
> Yours
> 
> Manuel Reimer
> 
> _______________________________________________
> vdr mailing list
> vdr at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



More information about the vdr mailing list