Author |
Message |
knappster
|
Posted: Mon Dec 15, 2008 1:04 pm |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
I've been trying to figure this out since I started using mythwelcome in R5F27... It's a combined FE/BE and I use a wakeup period, which would go from 6:30am-10:00pm. With R5F27 if the frontend was left on, it would usually stay on throughout the night, even if the frontend was on the main screen. However, sometimes (not very often) it would automatically shutdown and then turn back on at 6:30 am the next morning, even if the frontend was up.
So I changed the wakeup period from 6:30am-2pm so that if I am on vacation, it would not turn on for as long. Again, usually as long as the frontend was up, the system would stay on. Once in a while, it would still turn itself off in the afternoon (I think it was usually around 4-4:30 for some reason)
Now I am getting 5.5 up and running and decided to make that period even shorter, from 6:30am-11:00am thinking that since I watch tv in the morning it will stay on all day as long as I don't exit the frontend. Well, about 11 am this morning mythweb quit working, so the odds are, it shut down again.
I've browsed through the mythwelcome page on the mythtv wiki http://www.mythtv.org/wiki/index.php/Mythwelcome, and it states: Quote: All frontends must exit before it shuts down. But it doesn't seem like this is always true. Is it supposed to be idle only when some task is being performed (watch tv/recording, transcoding, mythfilldatabase, etc.), or is it idle when no task is being performed AND no frontends are connected?
|
|
Top |
|
|
alien
|
Posted: Tue Dec 16, 2008 2:21 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
"All frontends must exit before it shuts down" isn't quite true. "The backend has no connections to any frontends" is a bit more accurate.
I've had scenarios where the frontend looses connection with backend. If the backend is restarted for any reason (ex. a backup), this will happen. For some reason, the frontend will not re-connect to the backend once it is back and the system will shutdown.
If this happens again, you might want to check the backend logs to see what happened.
Cheers,
Allen
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
knappster
|
Posted: Sat Jan 24, 2009 6:09 pm |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
This happened again last night, except I was watching a DVD with xine at the time of shutdown. Here's a chunk of the backend log:
Code: 2009-01-23 20:26:27.057 I'm idle now... shutdown will occur in 400 seconds. 2009-01-23 20:32:02.385 UPnpMedia: BuildMediaMap VIDEO scan starting in :/myth/video: 2009-01-23 20:32:02.472 UPnpMedia: BuildMediaMap Done. Found 20 objects 2009-01-23 20:32:35.382 AutoExpire: CalcParams(): Max required Free Space: 1.0 GB w/freq: 15 min 2009-01-23 20:33:28.659 MainServer::HandleAnnounce Monitor 2009-01-23 20:33:28.661 adding: mythtv as a client (events: 0) 2009-01-23 20:33:28.662 MainServer::HandleAnnounce Monitor 2009-01-23 20:33:28.663 adding: mythtv as a client (events: 1) 2009-01-23 20:33:40.241 I'm idle now... shutdown will occur in 400 seconds. 2009-01-23 20:33:49.690 [mpeg2video @ 0xb7267e68]ac-tex damaged at 16 24 2009-01-23 20:33:49.693 [mpeg2video @ 0xb7267e68]Warning MVs not available 2009-01-23 20:33:50.253 Using runtime prefix = /usr 2009-01-23 20:33:50.257 Empty LocalHostName. 2009-01-23 20:33:50.257 Using localhost value of mythtv 2009-01-23 20:33:50.833 Cannot find default UPnP backend 2009-01-23 20:33:50.849 New DB connection, total: 1 2009-01-23 20:34:00.855 Connected to database 'mythconverg' at host: 192.168.1.210 2009-01-23 20:34:00.858 Closing DB connection named 'DBManager0' 2009-01-23 20:34:00.859 Deleting UPnP client... 2009-01-23 20:34:11.493 Connected to database 'mythconverg' at host: 192.168.1.210 2009-01-23 20:34:11.510 New DB connection, total: 2 2009-01-23 20:34:20.878 Connected to database 'mythconverg' at host: 192.168.1.210 2009-01-23 20:34:20.881 Current Schema Version: 1214 2009-01-23 20:34:21.201 AFD: Opened codec 0x82c73d0, id(MPEG2VIDEO) type(Video) 2009-01-23 20:34:21.202 AFD: codec MP2 has 2 channels 2009-01-23 20:34:21.203 AFD: Opened codec 0x82c7820, id(MP2) type(Audio) 2009-01-23 20:34:21.338 Preview: Grabbed preview '/myth/tv/5011_20090123183000.mpg' 720x480@94s 2009-01-23 20:40:41.567 MainServer::HandleAnnounce Monitor 2009-01-23 20:40:41.588 adding: mythtv as a client (events: 0) 2009-01-23 20:40:41.589 MainServer::HandleAnnounce Monitor 2009-01-23 20:40:41.590 adding: mythtv as a client (events: 1) 2009-01-23 20:40:50.254 CheckShutdownServer returned - OK to shutdown 2009-01-23 20:40:50.270 Running the command to set the next scheduled wakeup time :- /usr/bin/mythshutdown --setwakeup 2009-01-24:17:49 2009-01-23 20:41:11.363 Running the command to shutdown this computer :- sudo /usr/bin/mythshutdown --shutdown 2009-01-23 20:41:34.015 I'm idle now... shutdown will occur in 400 seconds. QSqlQuery::exec: database not open 2009-01-23 20:41:38.001 DB Error (KickDatabase): Query was: SELECT NULL; No error type from QSqlError? Strange... 2009-01-23 20:41:38.054 DB Error (JobQueue::CleanupOldJobsInQueue: Error deleting old finished jobs.): Query was: DELETE FROM jobqueue WHERE (status in (272, 288, 320) AND statustime < '2009-01-21T20:41:38') OR (status in (304) AND statustime < '2009-01-19T20:41:38') Driver error was [2/2006]: QMYSQL3: Unable to execute query Database error was: MySQL server has gone away
2009-01-23 20:41:38.066 Unable to connect to database! 2009-01-23 20:41:38.067 Driver error was [1/2003]: QMYSQL3: Unable to connect Database error was: Can't connect to MySQL server on '192.168.1.210' (111)
QSqlQuery::exec: database not open QSqlQuery::exec: database not open 2009-01-23 20:41:38.120 DB Error (KickDatabase): Query was: SELECT NULL; No error type from QSqlError? Strange... 2009-01-23 20:41:38.171 DB Error (HouseKeeper Cleaning TVChain Table): Query was: SELECT DISTINCT chainid FROM tvchain WHERE endtime > '2009-01-23T16:41:38' ; Driver error was [2/2006]: QMYSQL3: Unable to execute query Database error was: MySQL server has gone away
2009-01-23 20:41:38.172 Unable to connect to database! 2009-01-23 20:41:38.172 Driver error was [1/2003]: QMYSQL3: Unable to connect Database error was: Can't connect to MySQL server on '192.168.1.210' (111)
QSqlQuery::exec: database not open QSqlQuery::exec: database not open 2009-01-23 20:41:38.225 DB Error (KickDatabase): Query was: SELECT NULL; No error type from QSqlError? Strange... 2009-01-23 20:41:38.276 DB Error (Housekeeper Creating Temporary Table): Query was: CREATE TEMPORARY TABLE IF NOT EXISTS temprecordedcleanup ( chanid int(10) unsigned NOT NULL default '0', starttime datetime NOT NULL default '0000-00-00 00:00:00' ); Driver error was [2/2006]: QMYSQL3: Unable to execute query Database error was: MySQL server has gone away
2009-01-23 20:41:38.278 Unable to connect to database! 2009-01-23 20:41:38.279 Driver error was [1/2003]: QMYSQL3: Unable to connect Database error was: Can't connect to MySQL server on '192.168.1.210' (111)
QSqlQuery::exec: database not open QSqlQuery::exec: database not open 2009-01-23 20:41:38.331 DB Error (KickDatabase): Query was: SELECT NULL; No error type from QSqlError? Strange... QSqlQuery::prepare: database not open QSqlQuery::exec: database not open QSqlQuery::exec: database not open 2009-01-23 20:41:38.435 DB Error (KickDatabase): Query was: SELECT NULL; No error type from QSqlError? Strange... 2009-01-23 20:41:38.486 Database not open while trying to load setting: CleanOldRecorded 2009-01-23 20:41:38.499 DB Error (Error in JobQueue::GetJobs(), Unable to query list of Jobs in Queue.): Query was: SELECT j.id, j.chanid, j.starttime, j.inserttime, j.type, j.cmds, j.flags, j.status, j.statustime, j.hostname, j.args, j.comment, r.endtime, j.schedruntime FROM jobqueue j, recorded r WHERE j.chanid = r.chanid AND j.starttime = r.starttime ORDER BY j.schedruntime, j.id; Driver error was [2/2006]: QMYSQL3: Unable to execute query Database error was: MySQL server has gone away
And that is it until I started it back up a couple minutes later. However, ever since then, mythwelcome loads a blank screen with just the background. I have to kill off mythwelcome and then load mythfrontend manually.
I suppose the thing to do is check for mysql corruption because of those errors, but is anyone else experiencing this? The frontend was running, at the time of shutdown but nothing was recording. I was watching a DVD in xine, so I wasn't using the Internal player for anything either. If I could get mythwelcome to load properly I would tell you what some of the settings were, but at this moment that's not happening. Very strange...
edit 1:
Just checked for corrupt tables, and none were found.
edit 2:
I have found that if I run it from command line and wait a bit, after I hit CTRL+C a couple of times mythwelcome appears to be working normally. I have checked the settings and it shows wakeup interval from 6:30-20:00.
|
|
Top |
|
|
knappster
|
Posted: Tue Jan 27, 2009 12:34 am |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
Following this up, I just tried running mythwelcome for the first time since my last post, and it came right up normally. One other thing to note is that this confirms that when it was having a problem earlier, my mythfrontend loaded up a lot slower than usual as well. Now everything seems fine again (for the moment at least). I am going to try to have it automatically boot mythwelcome tomorrow morning and we will see what happens.
In the meantime, are there any tricks to getting it to not shutdown when I am viewing a movie in xine? Could I create a script to the effect of:
Code: #!/bin/sh trap "/usr/local/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM mythshutdown --lock xine -pfhq --no-splash
Assuming this website is correct: http://www.mythtv.org/wiki/Mythshutdown
I suppose I could use something similar as the script to start mythfrontend from mythwelcome in order to prevent the mysterious shutdowns when the frontend is left up if that is correct...
|
|
Top |
|
|
alien
|
Posted: Tue Jan 27, 2009 4:27 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
knappster wrote: In the meantime, are there any tricks to getting it to not shutdown when I am viewing a movie in xine? As long as you don't exit the frontend to watch a DVD, the system should not shut down.
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
knappster
|
Posted: Tue Jan 27, 2009 1:50 pm |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
alien wrote: knappster wrote: In the meantime, are there any tricks to getting it to not shutdown when I am viewing a movie in xine? As long as you don't exit the frontend to watch a DVD, the system should not shut down.
But it sometimes does. In my log you can see that the 400 second countdown restarted a couple of times. The whole time the frontend should have been running and the DVD was playing on xine from the frontend menu. It had happened before and I think the idle delay was set for 120 seconds at the time, so I bumped it up to 400 thinking that if it was for any reason temporarily losing connection to the backend that it would be plenty of time to recover.
I assume all of the mysql errors in the log are because mysql was stopped for shutdown and a process was trying to read/write to the database. To me it seems like it would be cleaner to implement a hard lock for shutdown when the frontend is running in the first place, but if you have any suggestions or ideas, I would certainly give them a go just to try to figure out why this is happening.
|
|
Top |
|
|
jbm2131
|
Posted: Tue Jan 27, 2009 11:30 pm |
|
Joined: Sat Sep 02, 2006 1:46 pm
Posts: 44
|
knappster wrote: Code: 2009-01-23 20:33:50.253 Using runtime prefix = /usr 2009-01-23 20:33:50.257 Empty LocalHostName. 2009-01-23 20:33:50.257 Using localhost value of mythtv 2009-01-23 20:33:50.833 Cannot find default UPnP backend 2009-01-23 20:33:50.849 New DB connection, total: 1
That section of your mythbackend.log seems to be indicating that your mythbackend restarted at that point (at least that text seems to be spit out in my backend log whenever the backend starts). From my experience, the disabling of shutdown while the frontend is up works flawlessly, except for the following situation:
1. I stop the backend while mythwelcome and mythfrontend are running (in order to run mythtv-setup for example)
2. I restart the backend
3. Since the new backend (and mythwelcome as well) don't know about the previously running frontend, the box shuts down
This has bitten me a few times before I caught on to what was happening. I now make sure I exit the frontend into mythwelcome and restart a new frontend after the backend restarts. From your log file, it seems like you may be having a similar problem. Not sure why your backend would be dying and then restarting, but I think that could be the root cause. Also, I don't think increasing the idle delay value helps this, because I don't think it automatically recovers -- a new frontend session needs to be started. If you can't figure out why this is happening, I guess you will need the hard lock solution, but it seems like there is a underlying problem that needs to be fixed.
|
|
Top |
|
|
knappster
|
Posted: Wed Jan 28, 2009 8:11 am |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
Thanks for your input. I hadn't really considered the backend restarting, so that gives me something to figure out. I guess I will go through the logs and see if I can find a pattern. In the meantime, I am using a script for DVDs:
Code: #!/bin/sh trap "/usr/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM mythshutdown --lock xine -pfhq --post tvtime:method=Greedy2Frame,enabled=1,chroma_filter=1,pulldown=vektor,framerate_mode=full,judder_correction=1,use_progressive_frame=yes --post unsharp:luma_amount=1.00 --no-splash --auto-scan dvd mythshutdown --unlock and a similar script for starting mythfrontend from mythwelcome: Code: #!/bin/sh trap "/usr/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM mythshutdown --lock /usr/bin/mythfrontend -l /var/log/mythtv/mythfrontend.log mythshutdown --unlock
|
|
Top |
|
|
knappster
|
Posted: Sat May 09, 2009 8:50 am |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
For some reason I am having the same issue with mythwelcome loading to a blank background again. I haven't had any unusual shutdowns like I did when this happened in the past. Mythwelcome did the automatic shutdown last night, automatically booted again this morning, but instead of showing information and giving the option to open the frontend it is just the theme background and nothing else.
I can start mythfrontend manually, but that requires sshing into the box to do it. I've been scouring the logfiles, but I can't find anything useful. I have run the optimize_db script with no improvement. It has been restarted multiple times. Does anyone have an idea where to look? As you might imagine, the WAF is dropping at an exponential rate.
|
|
Top |
|
|
knappster
|
Posted: Thu May 14, 2009 9:44 pm |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
It's back to working normally now... This is just becoming silly.
|
|
Top |
|
|
alien
|
Posted: Fri May 15, 2009 3:27 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
Next time it happens, you might try <alt>-<tab> a few types to cycle through the windows. Maybe they are stacked in the wrong order for some reason. I believe when the frontend is running, mythwelcome is a "blank" background screen. If it is on top of the frontend instead of behind, that might cause your problem.
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|