default_mobilelogo

WOL einrichten

(frei nach http://www.mythtv.org/wiki/ACPI_Wakeup)

 

Einstellen BIOS

Bei Asus M5A78L-M -Board m BIOS: Power -> APM Configuratiom "Power on From S5 by PME#" -> "Enable"
(WakeUp from RTC unbedingt „disabled" lassen !)

 

Einstellen Xubuntu / MythTv

BootEintrag für Xubuntu anpassen:

sudo vi /etc/default/grub

Zeile GRUB_CMDLINE_LINUX="" ergänzen zu:

GRUB_CMDLINE_LINUX="hpet=disable"

Importieren mit

sudo update-grub

 

Anlegen Datei setwakeup.sh unter /usr/bin

#!/bin/bash
#$1 is the first argument to the script. It is the time in seconds since 1970
#this is defined in mythtv-setup with the time_t argumentecho 0 > /sys/class/rtc/rtc0/wakealarm #this clears your alarm.
echo $1 > /sys/class/rtc/rtc0/wakealarm #this writes your alarm
echo $1 > /sys/class/rtc/rtc0/wakealarm #sicherheitshalber nochmal - manche Boards brauchens zweimal...LOG_FILE='/var/log/mythtv/hwclock-rebootTime.log' #log file# Now write the time the system is expected to come out of power save mode
# so there is at least a small record of when if it was supposed to recover# Note:- Log file will just keep growing# date in Epoch format
a="'date +%s'"# Subtract Current time from Future time
let "b=$1-$a"# echo $b
# echo "result of time subtraction 'date -d @$b'"# Get Date and Subtract 1,.. as date starts from 1st Jan 1970
dte='date -d @$b +%d'
let "dte -= 1"echo "Current Time ->'date'" >> $LOG_FILE# Simple check to determine if to include days in output string
if (dte=0)
then
echo "Shutting down for ->'date -d @$b +%Hhrs:%MMins'" >> $LOG_FILE
else
echo "Shutting down for ->$[dte]Days 'date -d @$b +%Hhrs:%MMins'" >> $LOG_FILE
fiecho "Wake up at approx.->'date -d @$1'" >> $LOG_FILE
echo "------------------------------------------------------" >> $LOG_FILE

Anlegen Datei checklogin.sh unter /usr/bin

#!/bin/bash
# Check to see if anyone is currently logged in or if the machine was recently switched on.
# Echoed text appears in log file. It can be removed and --quiet added to the
# grep command once you are satisfied that mythTV is working properly.
# Exit codes:-
# 2 - Machine recently switched on, don't shut down.
# 1 - A user is logged in, don't shut down.
# 0 - No user logged in, OK to shut down.# Customizable variables
MIN_UPTIME=20 # Minimum up time in minutes
# End of customizable variables# Get a date/time stamp to add to log output
DATE=`date +%F\ %T\.%N`
DATE=${DATE:0:23}UPTIME=`cat /proc/uptime | awk '{print int($1/60)}'`if [ "$UPTIME" -lt "$MIN_UPTIME" ]; then
echo $DATE Machine uptime less than $MIN_UPTIME minutes, don\'t shut down.
exit 2
fi# Some configurations ( at least lxdm + xfce4) do not report GUI-logged-on users
# with "who" or "users".
# pgrep tests if processes named xfce* existXFCE_PROCS=`pgrep xfce`USERS=`who -q | tail -n 1 | sed 's/[a-z #]*=//'`if [ "$USERS" == "0" ] && [ "$XFCE_PROCS" == "" ]; then
echo $DATE No users are logged in, ok to shut down.
exit 0
else
echo $DATE Someone is still logged in, don\'t shut down.
exit 1
fi

 

Ausführbar machen der beiden Dateien

chmod +x /usr/bin/setwakeup.sh
chmod +x /usr/bin/checklogin.sh

Mythtv-Nutzer ermöglichen, ohne Password sudo zu nutzen.

Dazu mit sudo visudo am Ende der Datei /etc/sudoers folgende Zeile hinzufügen

%mythtv ALL = NOPASSWD: /sbin/shutdown, /usr/bin/setwakeup.sh, /usr/bin/checklogin.sh

 

Einstellen  Backend

DIE NICHT DARGESTELLTEN SEITEN WURDEN MIT DEN STANDARDEINSTELLUNGEN EINFACH WEITER GEKLICKT !

DIE LETZTE EINSTELLUNGSSEITE MUSS JEWEILS MIT FERTIG ABGESCHLOSSEN WERDEN

(ESC BRICHT JEWEILS AB BZW. SPRINGT EINE SEITE ZURÜCK)

  1.WOL1 

  2.WOL2

 

Wenn noch nicht geschehen (in MythbutuControlCenter) muss noch der automatische Login deaktiviert werden:

sudo vi /etc/lightdm/lightdm.conf

Dort die Zeile autologin-user=xxx auskommentieren.