McenterFreak Posted October 1, 2016 Share Posted October 1, 2016 As the Topic says. When i Hoover over the RS Icon its always red, and informs that there are running Timers, but its wrong. Link to comment
McenterFreak Posted October 5, 2016 Author Share Posted October 5, 2016 Anybody knows? Link to comment
Griga Posted October 5, 2016 Share Posted October 5, 2016 There are other timer types besides recording timers... they should show up in the web interface on the Timer page. Link to comment
HaraldL Posted October 5, 2016 Share Posted October 5, 2016 If I see it correctly the screen shot shows minus(!) six timers, a negative number?? Link to comment
McenterFreak Posted October 5, 2016 Author Share Posted October 5, 2016 There are other timer types besides recording timers... they should show up in the web interface on the Timer page. I did check that. No Timers. But now my Windows RS server has installed windows updates and rebooted. Now Blue Icon and no Timers. Lets see what happens Link to comment
Griga Posted October 6, 2016 Share Posted October 6, 2016 If I see it correctly the screen shot shows minus(!) six timers, a negative number?? Very attentive! I didn't see that. So it can be easily fixed: Just add timers until none is left Well, kidding aside: This should never happen. I'll check it... Link to comment
Griga Posted October 6, 2016 Share Posted October 6, 2016 I've checked it in the code.There are measues that prevent recording timers from being started / stopped more than once. However, I can't find such measures for task timers and auto search timers, so I guess this is the source of the trouble. In theory a single timer can be stopped several times sequently or be stopped without having been started, each time decrementing the running timers count, so that it eventually gets negative. It would be good to know which type of timer is causing it. Link to comment
McenterFreak Posted October 6, 2016 Author Share Posted October 6, 2016 I now have -1 timer running when i hoover the red RS icon I do have 1 tasktimer running every day. Its an xepg task timer with this content: "C:\Program Files\Xepg\Xepg.exe" -xGrabThenImport But it dosen't work To have my EPG updated, i need to run the xepg tool manually to update my EPG Link to comment
Griga Posted October 6, 2016 Share Posted October 6, 2016 Thanks for the information. Do you also get a negative timer count if you remove the non-working Xepg task? Link to comment
Delphi Posted October 6, 2016 Share Posted October 6, 2016 I agree: try to remove the Xepg task. Remember to run the Config tool as administrator: svcoptions.exe (located in DVBViewer program folder) Also delete any occurrences of Xepg in RS web interface -> Timer (there should only be one) Restart everything. See what happens. Link to comment
McenterFreak Posted October 6, 2016 Author Share Posted October 6, 2016 Done this: In svcoptions: removed the Xepg task (svcoptions.exe told me that a timer was active, and asked if it should be stopped. No timer was actualy running, so i think it was the "wrong" task. I said yes. After that the -1 timer was removed, and RS icon changed from red to blue) In RS: Removed the Xepg task that was scheduled for tomorrow morning 5:00 What next? I really would like to get the automation in Xepg up and running Link to comment
Delphi Posted October 6, 2016 Share Posted October 6, 2016 First check whether Xepg is actually running (I have never seen such a thing before) by opening Windows Joblist (Ctrl+Alt+Delete). If running, kill it (Afslut job (Danish)). Then try to set up again following help to Automate, but replace In the right click menu of the Recording Service: Configure --> Tasks --> New (button) with In explorer locate scvoptions.exe in DVBViewer program folder, right click and select Run as administrator, then Tasks --> New (button) @Griga: I suggest something like: remove the Tasks from svcoptions.exe, then create say svctasks.exe handling this. In the right click menu add Configure Tasks (should have a shield icon, since svctasks.exe requires elevation). Here is what I use (Delphi XE2) to run an external process as administrator: procedure RunAndWaitFor(Handle: HWND; aFile: TFileName; aParameters: string; RunAsAdministrator: boolean); var SEInfo: TShellExecuteInfo; ExitCode: LongWORD; begin FillChar(SEInfo, SizeOf(SEInfo), 0) ; SEInfo.cbSize := SizeOf(TShellExecuteInfo) ; if RunAsAdministrator then begin SEInfo.fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_FLAG_DDEWAIT or SEE_MASK_FLAG_NO_UI; SEInfo.lpVerb := 'runas'; end else SEInfo.fMask := SEE_MASK_NOCLOSEPROCESS; SEInfo.Wnd := Handle; SEInfo.lpFile := PChar(aFile); SEInfo.lpParameters := PChar(aParameters) ; // SEInfo.lpDirectory := PChar(WorkingDirectory) ; SEInfo.nShow := SW_SHOWNORMAL; if ShellExecuteEx(@SEInfo) then begin repeat Sleep(200); // to reduce CPU usage GetExitCodeProcess(SEInfo.hProcess, ExitCode); until ExitCode <> STILL_ACTIVE; end else RaiseLastOSError; end; Link to comment
McenterFreak Posted October 8, 2016 Author Share Posted October 8, 2016 First check whether Xepg is actually running (I have never seen such a thing before) by opening Windows Joblist (Ctrl+Alt+Delete). If running, kill it (Afslut job (Danish)). Then try to set up again following help to Automate, but replace In the right click menu of the Recording Service: Configure --> Tasks --> New (button) with In explorer locate scvoptions.exe in DVBViewer program folder, right click and select Run as administrator, then Tasks --> New (button) Done that. Same problem. Tasktimer implemented as described. Running every night 00:10 to 00:20. Now have -1 timer active Link to comment
Delphi Posted October 8, 2016 Share Posted October 8, 2016 Don't know what's happening. Running every night 00:10 to 00:20 It's a bit short time? I know Xepg usually only takes less than a minute to execute.I don't know whether the end time is taken in account for a process task timer.Try 00:10 to 02:00 (from my post): First check whether Xepg is actually running by opening Windows Joblist (Ctrl+Alt+Delete) Was Xepg running? Link to comment
McenterFreak Posted October 8, 2016 Author Share Posted October 8, 2016 Don't know what's happening. It's a bit short time? I know Xepg usually only takes less than a minute to execute. I don't know whether the end time is taken in account for a process task timer. Try 00:10 to 02:00 Was Xepg running? Xepg was not running. I have changed the time to 00:10 to 02:00. I will post the result tomorrow. Have you tried to run the task manually from RS? When i do this, nothing happens Link to comment
Delphi Posted October 8, 2016 Share Posted October 8, 2016 Please upload tasks.xml from <DVBViewer Program Folder>\config Link to comment
McenterFreak Posted October 8, 2016 Author Share Posted October 8, 2016 Here it is tasks.xml Link to comment
Delphi Posted October 8, 2016 Share Posted October 8, 2016 Here is the error: <Filename>"C:\Program Files\Xepg\Xepg.exe"</Filename> should be (no quotes in this case) <Filename>C:\Program Files\Xepg\Xepg.exe</Filename> Best way is to use the Copy buttons from Xepg -> Automate for configuring a process task. @Griga: Let me guess: When ShellExecuteEx returns False the counting goes wrong. Link to comment
McenterFreak Posted October 8, 2016 Author Share Posted October 8, 2016 Here is the error: <Filename>"C:\Program Files\Xepg\Xepg.exe"</Filename> should be (no quotes in this case) <Filename>C:\Program Files\Xepg\Xepg.exe</Filename> Best way is to use the Copy buttons from Xepg -> Automate for configuring a process task. The reason for the double quotes is because i used the button "Copy Command Line to Clipboard". (maybe you should write something like "use only for a command prompt execution") Now i have stopped RS. Used Edit in svcconfig (as admin) Removed the quotes Started RS Executed the task And voila 3 more days of EPG Thanks! Link to comment
Delphi Posted October 8, 2016 Share Posted October 8, 2016 (edited) (maybe you should write something like "use only for a command prompt execution") Help to Automate line 7-11 Edited October 8, 2016 by Delphi Link to comment
McenterFreak Posted October 8, 2016 Author Share Posted October 8, 2016 Help to Automate line 7-11 As i always say RTFM Link to comment
Delphi Posted October 8, 2016 Share Posted October 8, 2016 (edited) @Griga: This thread got a bit cluttered up, so I will try to summarize: 1) Users problem solved: it was an illegal File Name for the process task, so Xepg was never called. 2) The negative "-6 timer(s) active" suggests a bug in RS: Assuming you are using ShellExecuteEx (I know there are other ways) to launch a task the Result (True/False) of ShellExecuteEx should be checked. If False this could very well produce those negative values (just guessing). Anyway it should be checked (and logged) whether the launch of the process task was unsuccessfull. 3) Having to run svcoptions.exe as administrator to add a task is not very user friendly: http://www.DVBViewer.tv/forum/topic/58750-rs-show-timers-but-no-timers-running/?p=451980 I took the liberty to additionally post a suggestion for a way to go. One way or the other I hope for improvements on this at some time. Edited October 8, 2016 by Delphi Link to comment
Griga Posted October 9, 2016 Share Posted October 9, 2016 Thanks for your great investigative work. It was difficult for me to reproduce the issue, because lately I've changed the communication between the RS and the Tray Tool which caused the icon not to get red anymore on a negative timer count. However, the change has only hidden the problem. The count still gets negative in case of faulty tasks, as the debugger shows, which is desastrous enough anyway The process timer never gets started due to a CreateProcess error, but it is stopped, which means, TimerCount + 1 is not executed, but TimerCount - 1 is executed without checking the actual state. The whole handling doesn't look well elaborated, since the running timers count is declared as unsigned integer (obviously a negative value was never considered), but in other parts it is handled as signed integer, particularly in the tray tool... 3) Having to run svcoptions.exe as administrator to add a task is not very user friendly: Unfortunately the possible solutions are not very developer friendly (several additional things like stopping/starting the RS in case of changed settings must be considered). The urgent thing to do was to fix the privilege escalation security hole resulting from a tasks.xml that was accessible with user rights and tasks executed with system rights. When I find time for it I'll try to make it more user friendly. Maybe next year... Link to comment
Griga Posted October 9, 2016 Share Posted October 9, 2016 P.S. I don't know whether the end time is taken in account for a process task timer. It isn't as far as I can see. A process timer is running as long as the task is running (which means REC is displayed on the Timer Page of the Web Interface). Link to comment
Recommended Posts