LinHES Forums http://forums.linhes.org/ |
|
MythWelcome - "MythTV is Idle" with no countdown http://forums.linhes.org/viewtopic.php?f=6&t=18815 |
Page 1 of 1 |
Author: | tzoom84 [ Tue Aug 19, 2008 5:43 am ] |
Post subject: | MythWelcome - "MythTV is Idle" with no countdown |
Hey all, I didn't want to threadjack over here so I figured a fresh post was worthy. I'm having problems with MythWelcome/MythBackend and I am having a hard time debugging. Essentially, in the past, mythwelcome would shutdown fine, and say "MythTV is idle and will shutdown in xxx seconds". But recently it just stopped counting down and just says "MythTV is idle". I checked the shutdown parameters and nothing has changed (the "block shutdown..." option is unchecked, mythwelcome shutdown is unlocked). So I started investigating the source code for mythwelcome. It seems an internal variable (m_secondsToShutdown) isn't set because a MythEvent isn't triggered. So, has someone run into this "MythTV is Idle" before? |
Author: | tzoom84 [ Sat Aug 23, 2008 12:53 pm ] |
Post subject: | |
Ok so the verbose mode was simple. "mythbackend --verbose [args]', changed in /etc/init.d/mythtv-backend file. I still can't seem to find out why mythwelcome occassionally says "MythTV is Idle" without counting down. After looking in the mythwelcome code, and debug, I noticed the countdown starts only after SHUTDOWN_COUNTDOWN is set, which occurs through a MythEvent. I also noticed that in the debug, when only "MythTV is Idle" is shown, no events occur. The events originate from scheduler.cpp, and are based on just simple logic. But I can't trace. Any recommendations? Or anyone have issues with MythEvents not being sent from the scheduler? |
Author: | silentmic [ Sat Aug 23, 2008 7:55 pm ] |
Post subject: | |
I've seen this. I'm not sure of it, but one thing which I think can cause it is when it thinks there are other frontends connected. Sometimes I've had a frontend running on a linux desktop and I've hibernated the desktop without exiting that frontend. The backend doesn't get the message that the frontend has exited. |
Author: | mythman13 [ Sun Aug 24, 2008 8:22 am ] |
Post subject: | |
Hi tzoom84, Just to check, if you don't use remote frontends that the setting "Block remote shutdown before client connected" under mythtv-setup -> General _> Shutdown/Wakeup Options is unticked. Because when my shutdown kept cycling I think it was because this was ticked and I don't have any remote frontends. Hope this helps, Mythman |
Author: | tzoom84 [ Sun Aug 24, 2008 4:14 pm ] |
Post subject: | |
The frontend I run is on the same machine as on the backend, and the "Block ..." setting is unticked. |
Author: | mythman13 [ Wed Sep 03, 2008 3:23 pm ] |
Post subject: | |
This is kinda spooky but I've just run into this last night... I switched by frontend / backend box on and watched a redorded show. Then wanted to watch another after deleting some old ones on my ext3 myth partition. But the screen just blanked with hard disk activity. This happens occasionaly and if you wait long enough it exits back to the menu with no error but this was a currently recording program and I couldn't wait for it to finish (I think it has trouble finding a bookmark or start of the show). So I pressed Ctrl-Alt-Backspace (not sure exactly what this does but it seems to have the desired effect of rebooting the frontend). Then it worked ok. So I left it recording some sport whilst I went to bed! I woke the next morning to discover it was still on with nothing scheduled to record?! Mythwelcome said "MythTV is idle" but with NO countdown timer! There are no other frontends connected. I haven't investigated it further except to say that the countdown does not occur after using Ctrl-Alt-Backspace. |
Author: | tzoom84 [ Wed Sep 03, 2008 5:13 pm ] |
Post subject: | |
I ran into a deadend this weekend and decided I must've broken something while installing some other things. So I decided to reinstall/restore R5.5. I'm slowly rolling out my custom updates until I see where it breaks. I'll report if I find anything. |
Author: | auttila [ Thu Sep 04, 2008 12:49 pm ] |
Post subject: | |
I have a fresh R5.5 install with only v4l drivers installed. I have exatcly the same problem: no countdown occurs. So most likely it's not any of your custom updates. Also a friend of mine (who is very accurate and has deeper knowledge in theses kind of things) has the same problem. |
Author: | tzoom84 [ Sun Sep 07, 2008 8:06 am ] |
Post subject: | |
Well, looks like with no other changes this has happened to me too again. I am at a complete loss for debugging, so I thought of a simple idea. The countdown works if I restart the backend when it locks up like this, so: Write a background script that essentially runs the preshutdown check, external to mythtv. Have it start at boot up and poll every X seconds if it is ready to shut down. Basically, ensure 1. Mythfrontend is not running 2. "mythshutdown --check" returns 0. If ok, don't shutdown, just restart the backend. That way it still goes through the mythtv built in shutdown process, but doesn't mess up recordings in the meantime. What do you think? Am I missing something? |
Author: | tzoom84 [ Mon Sep 29, 2008 7:53 pm ] |
Post subject: | |
I threw together a pretty simple script to fix the "MythTV is Idle" issue. It basically runs like the above post describes. Whenever the message is displayed, and the system is identified as Idle by MythShutdown, this script just restarts the backend so that the countdown can occur. Code: Code: #!/bin/bash
# Script designed to run in the background # Monitors to ensure backend hasn't clogged up resulting in a "MythTV is Idle" # in MythWelcome with no countdown to shutdown # Checks (1) if MythFrontend is closed, and (2) mythshutdown --check returns 0 (otherwise idle) # Essentially it is manually running what MythWelcome should take care of when the backend # sends the right signal # get some pretty date stuff # and set the exit state to default 0, or force shutdown mdy="`date +%Y-%m-%d`" hm1="`date +%T`" hm2="`date +%N | cut --bytes='1 2 3'`" hms="$hm1.$hm2" echo "$mdy $hms backendmonitor: TEST TOP!" >> /var/log/mythtv/mythpreshutdown.log initval=7m sleep $initval # Set sleep large enough so it allows regular countdowns to occur without constantly restarting backend # (at least 2X the countdown time) sleeptimer=7m echo "$mdy $hms backendmonitor: STARTING UP! (timer=$sleeptimer)" >> /var/log/mythtv/mythpreshutdown.log while [ 1 ]; do # Run forever mdy="`date +%Y-%m-%d`" hm1="`date +%T`" hm2="`date +%N | cut --bytes='1 2 3'`" hms="$hm1.$hm2" #Clear flags reloadflag=0 frontendflag=0 builtincheck=0 # Execute mythfrontend check frontendflag=`ps axu | grep -c 'mythfrontend'` frontendflag=$[$frontendflag-1] # Execute built in mythshutdown check command /usr/bin/mythshutdown -c builtincheck=$? # Run check if it should reload if [[ $builtincheck -eq 0 && $frontendflag -eq 0 ]]; then reloadflag=1 fi echo "$mdy $hms backendmonitor: Frontendflag = $frontendflag, Builtincheck = $builtincheck , ReloadFlag = $reloadflag" >> /var/log/mythtv/mythpreshutdown.log # Reload backend if necessary if [ $reloadflag -eq 1 ]; then echo "$mdy $hms backendmonitor.sh: Restarting backend because it may have paused up" >> /var/log/mythtv/mythpreshutdown.log /etc/init.d/mythtv-backend restart reloadflag=0 sleep $sleeptimer # Wait some time to allow for real restart fi sleep $sleeptimer echo "$mdy $hms backendmonitor: Checked ... (timer=$sleeptimer)" >> /var/log/mythtv/mythpreshutdown.log done I'm sure theres plenty of holes, but it has been good enough to get by for the past 2 weeks. As always, be sure to set up appropriate permissions, add it to your startup script, and set up sudo as needed. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |