diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-08-05 10:42:23 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-08-05 10:42:23 +0200 |
commit | 8bfe599830bad4528b4fa60dddaa3c0b8cb9c80d (patch) | |
tree | 6170b77550d2e3a4923fb6c57070c4c7242a8992 | |
parent | c325fe76ee94f0335486269362d0404def27d8d1 (diff) | |
download | vdr-8bfe599830bad4528b4fa60dddaa3c0b8cb9c80d.tar.gz vdr-8bfe599830bad4528b4fa60dddaa3c0b8cb9c80d.tar.bz2 |
Modified the shutdown mechanism, so that the shutdown script is never given a time in the past
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 6 | ||||
-rw-r--r-- | INSTALL | 11 | ||||
-rw-r--r-- | vdr.c | 8 |
4 files changed, 20 insertions, 7 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4ed23435..ca3a8432 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -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 @@ -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. @@ -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 @@ -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) |