[mythtv-users] Problems with automatic shutdown/restart

David Knight dlknight at sdf.lonestar.org
Sat Mar 30 15:03:37 UTC 2013


On Fri, March 29, 2013 11:36 pm, HP-mini wrote:
> Works very well here for years (now on 10.04 & 0.26+fixes).
>
> Problem could be:
> - "setwakeup.sh" is not running
> - BE user req. exe/scripts not in sudoers file.
> - not using the required time format
> - bios RTC is ignoring the alarm setting
>
> The wikis mention some bios (old?) required the bios manually set alarm
> to be disabled.
>
> Do your BE log file(s) show:
> - BE idle & ready to shutdown
> - BE runs "setwakeup.sh" ?
>
> Mine runs...
> Command to set wakeup time:
>    sudo sh -c "/usr/bin/setwakeup.sh $time"
> wake time format:
>    time_t
>
> The sudoers list must include BE user & list the requires executables
> (inc scripts) like /usr/bin/setwakeup.sh etc..

Mine also worked for several years without problems and then broke with
the upgrade to 0.26.

I'm also running a combined BE/FE but I do not use "mythshutdown" as I
could never get it to work correctly.

Instead I have all my settings configured within the backend setup
application (mythtv-setup):

Startup command = /usr/local/bin/wakeuptest.pl &status &
Block shutdown before client connected = ENABLED
Idle shutdown timeout (secs) = 120
Maximum wait for recording (mins) = 20
Startup before recording (secs) = 300
Wakeup time format = time_t
Command to set wakeup time = sudo /usr/local/bin/setwakeup.sh $time
Server halt command = /usr/local/bin/mythtv-suspend
Pre-shutdown-check command = mythshutdown --check

You can substitute "sudo shutdown -h now" or "sudo shutdown -P now" for
the Server halt command. I am using hibernate for my system so that I can
wake it using a USB MCE Remote.

Hibernate was another problem with 0.26 and didn't work when executed
directly from mythbackend / mythwelcome. I then found this:
http://ubuntuforums.org/showthread.php?t=1309655&s=e7c7ad97887955cef9cb07b7c2e8b35b&p=8526105#post8526105


The following script detects if the startup was automatic (for recording)
or manual (to watch TV etc).

wakeuptest.pl
-------------
[BEGIN]
#!/usr/bin/perl
# This script can be called when the mythtv backend starts to
# determine whether the frontend should be shutdown.
#
# If this boot was an automatic wakeup because there is something
# to record, the frontend is shutdown to allow the backend to
# shutdown the computer when it is done recording.
#
# Imporant:  In mythtv-setup, this script should be set up to
# be called in the background (with a trailing &) because of the
# sleep.

$kill_frontend = "killall mythfrontend";
$sleep_time = 60;

# Now the work starts...

if (@ARGV[0] eq "auto") {
   sleep $sleep_time;
   system "$kill_frontend";
}
[END]

Regards

Dave K.




More information about the mythtv-users mailing list