Modified the shutdown mechanism, so that the shutdown script is never given a time in the past

This commit is contained in:
Klaus Schmidinger 2006-08-05 10:42:23 +02:00
parent c325fe76ee
commit 8bfe599830
4 changed files with 20 additions and 7 deletions

View File

@ -581,6 +581,8 @@ Helmut Auer <vdr@helmutauer.de>
for reporting a problem with the "Press any key on the RC unit" step when learning
LIRC remote control codes
for suggesting to reduce the logging for the SVDRP GRAB command
for reporting that the shutdown script is given a reboot time in the past if there
is a recording going on or about to start, and the user insists in shutting down now
Jeremy Hall <jhall@UU.NET>
for fixing an incomplete initialization of the filter parameters in eit.c

View File

@ -4848,3 +4848,9 @@ Video Disk Recorder Revision History
in order to avoid excessive disk access (thanks to Artur Skawina).
- Fixed handling the running status of EPG events before the currently running one,
in case they are added after the current event (cont'd from version 1.4.1-2).
- Modified the shutdown mechanism, so that the shutdown script is never given a
time in the past (reported by Helmut Auer). If a timer is currently recording,
or a recording would start within the next 30 minutes (default for the "Min.
event timeout" setup parameter), and the user insists in shutting down now, the
reboot time given to the shutdown script will correspond to a time that is
"Min. event timeout" minutes (default is 30) in the future.

11
INSTALL
View File

@ -171,7 +171,7 @@ calling the shutdown program, but will rather continue normally until it
receives a SIGTERM when the computer is actually shut down. So in case
the shutdown fails, or the shutdown program for some reason decides not to
perform a shutdown, VDR will stay up and running and will call the shutdown
program again after another MinUserInactivity minutes.
program again after another five minutes.
If there are currently no timers active, both parameters will be '0'.
In that case the program shall not set the hardware for automatic restart
@ -191,11 +191,10 @@ that this is a user requested shutdown (resulting from pressing the "Power"
key). The shutdown program may use this information to decide whether or
not to actually perform the system shutdown.
If a timer is currently recording, the parameters will reflect the start
time of that timer. This means that the first parameter will be a time in
the past, and the second parameter will be a negative number. This only
happens if the user presses the "Power" key while a timer is currently
recording.
If a timer is currently recording, or a recording would start within the
next 30 minutes (default for the "Min. event timeout" setup parameter), and
the user insists in shutting down now, the first and second parameter will
correspond to a time that is "Min. event timeout" minutes in the future.
Before the shutdown program is called, the user will be prompted to inform
him that the system is about to shut down. If any remote control key is

8
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.276 2006/06/18 08:49:20 kls Exp $
* $Id: vdr.c 1.277 2006/08/05 10:40:57 kls Exp $
*/
#include <getopt.h>
@ -1166,6 +1166,12 @@ int main(int argc, char *argv[])
else
LastActivity = 1;
}
if (timer && Delta < Setup.MinEventTimeout * 60 && ForceShutdown) {
Delta = Setup.MinEventTimeout * 60;
Next = Now + Delta;
timer = NULL;
dsyslog("reboot at %s", *TimeToString(Next));
}
if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
ForceShutdown = false;
if (timer)