From patchwork Sun Mar 4 11:33:53 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12442 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.50) id 1HNp0P-00012u-Ax for vdr@linuxtv.org; Sun, 04 Mar 2007 12:35:57 +0100 Received: (qmail invoked by alias); 04 Mar 2007 11:34:32 -0000 X-Provags-ID: V01U2FsdGVkX1/0SdNNR5v0xdyPV02/96D4AqR1QlIsSAZQd8mQTX Xv8eC76Ny5q/8o Message-ID: <45EAAEA1.9030809@gmx.de> Date: Sun, 04 Mar 2007 12:33:53 +0100 From: Udo Richter User-Agent: Thunderbird 2.0pre (Windows/20070302) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] vdr-1.5.1 & problems with the new shutdown code References: <45E9BA3B.7050605@gmx.de> In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 11:35:57 -0000 Status: O X-Status: X-Keywords: X-UID: 12359 Rolf Ahrenberg wrote: > No "assuming manual start of VDR" entry found on my logs, so this really > was on automatic wakeup for the timer. If VDR did detect it as manual start, then something else must have caused VDR to believe that there's an interactive user. Something triggers the activity, maybe a plugin? > Mar 4 02:05:57 xxx vdr: [6748] next timer event at Sun Mar 4 10:58:00 > 2007 > > Mar 4 10:58:00 xxx vdr: [6688] timer 18 (5 1058-1130 'xxx') start > ... and vdr just stays on ... ... and I assume that VDR started not more than 10 minutes before, eg. after 10:48? Please add the attached patch, it logs some more infos that might shed light on this. This gives log lines like this: Mar 4 12:11:18 xx vdr: [3788] Manual Start check: Delta = 240 - means on VDR startup, the expected vs. now time was 240 seconds, VDR started 4 minutes before planned. The following log lines get dumped once a minute: Mar 4 12:12:20 xx vdr: [3788] LastActivity: Never Mar 4 12:12:20 xx vdr: [3788] ActiveTimeout: 62 Mar 4 12:12:20 xx vdr: [3788] Retry: Never - No keyboard activity ever, no interactive user, ready to shut down again since 62 seconds. Never tried to restart. Thats how it should look like. Mar 4 12:14:20 xx vdr: [3788] LastActivity: 36 Mar 4 12:14:20 xx vdr: [3788] ActiveTimeout: -1164 Mar 4 12:14:20 xx vdr: [3788] Retry: Never - This is after activity: Last key stroke 36 seconds ago, no automatic shutdown for next 1164 seconds. Cheers, Udo Index: vdr.c =================================================================== --- vdr.c (Revision 874) +++ vdr.c (Arbeitskopie) @@ -1193,6 +1193,37 @@ // Main thread hooks of plugins: PluginManager.MainThreadHook(); + + +#define DebugTimeouts +#ifdef DebugTimeouts + + static time_t DebugTime = time(NULL); + time_t Now = time(NULL); + if (Now - DebugTime >= 60) { + time_t LastActivity = cRemote::LastActivity(); + if (!LastActivity) + dsyslog("LastActivity: Never "); + else + dsyslog("LastActivity: %5i ",(int)(Now - LastActivity)); + + time_t ActiveTimeout = ShutdownHandler.GetUserInactiveTime(); + if (!ActiveTimeout) + dsyslog("ActiveTimeout: Never "); + else + dsyslog("ActiveTimeout: %6i ",(int)(Now - ActiveTimeout)); + + time_t Retry = ShutdownHandler.GetRetry(); + if (!Retry) + dsyslog("Retry: Never "); + else + dsyslog("Retry: %6i ",(int)(Now - Retry)); + + DebugTime = Now; + } + +#endif + } if (ShutdownHandler.EmergencyExitRequested()) Index: shutdown.c =================================================================== --- shutdown.c (Revision 874) +++ shutdown.c (Arbeitskopie) @@ -103,6 +103,8 @@ void cShutdownHandler::CheckManualStart(int ManualStart) { time_t Delta = Setup.NextWakeupTime ? Setup.NextWakeupTime - time(NULL) : 0; + + dsyslog("Manual Start check: Delta = %i", (int)Delta); if (!Setup.NextWakeupTime || abs(Delta) > ManualStart) { // Apparently the user started VDR manually