View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 9 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Feb 15, 2005 8:53 am 
Offline
Joined: Tue Jan 18, 2005 12:11 pm
Posts: 100
Location: MA, USA
Hi, I've been trying to set up sleep/wakeup type behaviour on R4V5. The Wiki has WakeupToRecord. Looks great, with the associated green benefits in both the wallet and environmental sense. Unfortunately, I'm having problems with it.

[Edit: problems are resolved and reflected in the Wiki - all that's left is some odd behaviour where "halt" causes "reboot" - possibly unrelated]

I still have to do more diagnostics, but the oddest thing is that when I did "halt" at the command line, the machine now does a reboot. Does anyone know why that might happen? I haven't messed with runlevels or anything.

Probably related to this halt/reboot, when MythTv tries to shut down because it's idle, the machine just endlessly reboots. I had the idle timeout set to 10s, so I only had a short time to get in and disable it! [Edit: the problem wasn't related - turns out I missed a step in the instructions and didn't test it properly - see below]

Tangentially, the anonymity of the Wiki lowers the barrier to participation, but it does mean you don't know who to contact about topics...


Last edited by jimmyfergus on Tue Feb 15, 2005 2:09 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 9:00 am 
Offline
Joined: Tue Jan 18, 2005 12:11 pm
Posts: 100
Location: MA, USA
Oh yeah, a further question: if you halt from the KnoppMyth menu, will the halt command configured in mythtv-setup be executed? i.e. will the machine later wake up appropriately?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 9:13 am 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
not sure about the first question, but I do have an answer to the second question the halt command from the knoppmyth menu runs whatever command is in the .xml file. I believe it's just shutdown -h now, but it has nothing to do with anything in mythtv-setup.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 10:48 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
That wiki entry would be mine... sorry I didn't put an email address in it, but I find that any email address I put into something like that quickly gets flooded with spam.

I just realized I forgot that one must run lilo after editing lilo.conf. I've updated it. Maybe that was your problem?

Is your lilo.conf correct? The PowerOff image should be set to simply shutdown. Maybe you could post it.

Did you check "block shutdown before client connected"? This should have stopped the backend from rebooting the computer immediately.

Finally, try testing the shutdown and reboot commands directly:

"sudo lilo -R PowerOff ; sudo reboot" should reboot the computer into an image that simply shuts down (this is necessary to update the wakeup time correctly when it changes)

"sudo halt" will shutdown the system directly.

As for the halt causing a reboot, this is strange... what time is set in the BIOS for the wakeup? Maybe the BIOS is causing a wakeup for some reason.

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 11:07 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
jimmyfergus wrote:
Oh yeah, a further question: if you halt from the KnoppMyth menu, will the halt command configured in mythtv-setup be executed? i.e. will the machine later wake up appropriately?

The wakeup will not be set if the halt command is used. This is "Problem #3" in wiki. You can change the halt command to be "killall mythfrontend" (once everything is working) and then the backend will set the time correctly and shut down the computer after 10 seconds.

I've added more warnings to the wiki plus an reference back to me.

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 11:48 am 
Offline
Joined: Tue Jan 18, 2005 12:11 pm
Posts: 100
Location: MA, USA
First, thanks for the Wiki entry Alien - it's a good one.

I did run lilo and check "block shutdown". My lilo.conf has the Wiki "2b" option exactly (no additional lines).

I found one problem - I'd failed to correctly add lilo to /etc/sudoers. (I tested while logged in as root :oops:). Now, as mythtv user, if I run "sudo lilo -R PowerOff; sudo reboot", it does exactly what it should do - shuts down, restarts when it is set to. This explains why I had the endless rebooting, and the tests you've now added to the Wiki would have caught this.

This doesn't explain my halt/rebooting oddness! And further, if I try to set startup to 10 minutes from now:

Code:
sudo nvram-wakeup -C /etc/nvram-wakeup.conf -s $((`date +%s` + 600))


It actually seems to set it up for 5 minutes from now, not 10. If I change it to "+ 900", it sets it for 10 minutes out. So, perhaps my nvram-wakeup config isn't setting the values correctly, and this is leading the BIOS to do a sort of 'panic reboot'...

My mobo is Dell, for which I have little info. I made a conf file for it following the nvram-wakeup instructions. Since I think it needs the reboot, so I added the line "need_reboot = ON_ANY_CHANGE" to the conf, which results in the right return value for your perl script. (by the way, what does the >>8 do to the nvram-wakup call's return value? I would have imagined it was a shift operator which wouldn't make sense).

If I run either "halt", "init 0", or "shutdown -r now", from the command line, it reboots. At the moment the only way I seem to be able to halt the machine is with "lilo -R PowerOff; reboot"!

I have further investigation to do... I can see I have to take my monitor into the living room. It's unfortunate that PVR350 can't have the console output to the TV.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 12:04 pm 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
jimmyfergus wrote:
It actually seems to set it up for 5 minutes from now, not 10.

According to the man pages, nvram-wakeup subtracts 5 minutes from the startup time to give the computer time to reboot (the time given is assumed to be the time the computer should be functioning).
jimmyfergus wrote:
(by the way, what does the >>8 do to the nvram-wakup call's return value? I would have imagined it was a shift operator which wouldn't make sense).

That's just the way perl's system command works. I think the lower 8 bits are used for system's RC and the upper for the command that it executed. Shifting right 8 bits results in nvram-wakeup's return code.

jimmyfergus wrote:
If I run either "halt", "init 0", or "shutdown -r now", from the command line, it reboots. At the moment the only way I seem to be able to halt the machine is with "lilo -R PowerOff; reboot"!

This is strange. Does "shutdown -h now" work? If not, you might want to try nvram-wakeup -d (to disable) or knoppmyth-nvram-shutdown 0. Maybe your MB is waking up because the previous wakeup was so recent...

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 1:30 pm 
Offline
Joined: Tue Jan 18, 2005 12:11 pm
Posts: 100
Location: MA, USA
alien wrote:
According to the man pages, nvram-wakeup subtracts 5 minutes from the startup time to give the computer time to reboot (the time given is assumed to be the time the computer should be functioning).


I missed that (actually, I still can't find it). So at least it's working correctly. In fact, your whole system is working correctly, thanks.

alien wrote:
This is strange. Does "shutdown -h now" work?


Ah, typo, I meant "shutdown -h now" - it reboots for me, just like "halt" or "init 0". I'm pretty sure they all just run "init 0" anyway.

So I still have my init/reboot mystery, but it looks like the wakeup system is working fine in R4V5 - I'll annotate the Wiki. Thanks for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 26, 2005 9:30 am 
Offline
Joined: Tue Jan 18, 2005 12:11 pm
Posts: 100
Location: MA, USA
An additional report - I've had to disable it, because it's proven unreliable. The backend keeps crashing, something to do with commercial detection.

It seems mythbackend doesn't prevent shutdown when commercial detection jobs are running. When it starts up, it usually finds some commercial detection jobs to do from the last run, starts them, and sometimes segv's, leaving the machine running but no MythTv.

I disabled the auto-shutdown and all seems to be happy again.

I seem to attract bizarre behaviour: if I ran mythbackend interactively (user mythtv or root), it didn't segv, but it segv's if I run it from root as 'su - mythtv "mythbackend"', or via /etc/init.d/mythtv-backend.

This is all in R4V5. When I decide to move to R5, I'll give it another go. For now, I don't really have enough time and inclination to investigate.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 89 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu