Looking for better ideas how how to sleep/suspend my unraid box


Recommended Posts

My suspend works great, also the WOL, but sometimes when waking the server the unRAID server starts up the fan are running but that's it, the server are not online. so the only thing is to powerdown, when starting up it do a parity check.

 

Have someone else this issue ?

 

 

After googling I see there could be some issue with this driver r8169

 

http://www.google.se/search?q=pm-suspend+%2Br8169&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:sv-SE:official&client=firefox-a

 

This is what I have.

NIC driver info (from ethtool -i)

driver: r8169
version: 2.3LK-NAPI
firmware-version: 
bus-info: 0000:03:00.0

 

 

 

But I have run very many suspend & WOL and so far it's looks good, right now I using Pm-utils to suspend my server :-) so far so good....

 

 

Mmm thanx this sound quite similar but mine reboots continuosly after I try wake it up

 

unraid detects me:

 

root@Tower:~# ethtool  -i eth0

driver: r8169

version: 2.3LK-NAPI

firmware-version:

bus-info: 0000:04:00.0

 

, but i have a RTL8111B

 

can i make it load a different driver? (i'm a linux noob) or better should I wait for a new version of unraid.

 

Im guessing you have my motherboard and have gotten wake it up  . I'm going to read about Pm utils  . thanx for the answer it seems like my MB is ok and all that it needs is a more compatible driver.

 

I'll come back in a few days... after I change some confs. ;)

Link to comment

@peter_sm

 

I've been following this thread and I'm having the same issues on power-up after sleep. Fans and lights come on but the server is unreachable. I'm running a Supermicro MBD-C2SEA-O mobo. Unfortunately this appears to be a sporadic issue, my machine will successfully WOL 5 times out of 10.

 

Sleep & WOL was working previously before I added 2 more drives an additional sata backplane and sata card. Before I go out and get another PSU I was wondering if you had any luck getting your machine to wake from sleep correctly.

Link to comment

With the release of v4.5, I'm considering adding a cache drive into my system - but would the nighttime copy still work if the system were asleep (more than likely at 3am)? I'm guessing it wouldn't... :(

 

Is there a way to wake a system automatically at (say) 2:55AM every morning in time for the cache copy to work? Or would I have to get another server to wake up the unRAID server every morning.

 

Just wondering.

Link to comment

Easiest would be to add a line like this to your "sleep" script to move files from the cache drive before going to sleep.  then, it does not matter if the server is sleeping at 3 am.  If there are no files to move from cache, the "mover" script will take only a fraction of a second to run and the server will go to sleep immediately.  If there are files to move, the server will move them and then go to sleep.

 

# Do pre-sleep activities

/usr/local/sbin/mover                  <-- new line to move files off of cache.

# Go to sleep

   echo 3 > /proc/acpi/sleep                         <-- existing line to put server to sleep

 

Joe L.

Link to comment

I found a second condition causing unwanted sleep initiation while playing music through my media player (WDTV).

 

My earlier issue was caused by sufficient data being buffered in the unRAID RAM to allow the hard drives to spin down while still streaming music. We addressed this by modifying the script to use bwm-ng to check network traffic and to not allow sleep when traffic was present.

 

Seems there is also enough music buffered within this player (~70-90 seconds worth) to pause streaming near the end of tracks thus causing bwm-ng to report zero net traffic if the S3 script happens to check during those times. This occurred rarely enough that it took me awhile to track down the issue and come up with a fix.

 

The previous script has bwm-ng check average traffic over the default span interval of 30 seconds.

 

The following highlighted code changes this span to 120 seconds and this apparently corrects the issue with my player. A player with a larger buffer might require a larger span.

 

  bwm-ng -o csv -c 1 -d 0 -T avg -A 120 | grep eth0 | cut -d";" -f5

 

A script with this mod is attached. Of course, it should be renamed from .txt to .sh to make it executable.

 

Edit 2010-01-22: Further testing revealed the problem was still not 100% cured with this setting. So I changed it to -A 180. So far so good. Testing is time consuming though, so it may take awhile to be certain I have this completely fixed. And, as I mentioned, results will likely vary with different media players.

 

Edit 2010-02-09: Attachment deleted. Contained syntax errors.

Link to comment
  • 3 weeks later...

Hi all,

 

Firstly, great work by all those involved....this thread has been invaluable in setting up my unraid NAS.  :) I have one problem though that hopefully someone can help with...

 

I've used the latest scrip including all the whistles and bells. The only part I'm not using is the countdowntimer during set hours.

 

The NAS is waking and going to sleep as expected apart from when I have media players online; it's still going to sleep?? I've set the IP's in the script to ping the media players (2-off) but unless the NAS is being used (read or written too), the drives still spin down and it goes into S3...please note that if i'm wathcing a film it doesnt go to sleep - just when the players are on but the NAS is not being accessed.

 

I'm assuming this might have something to do with the implementation of 'bwm-ng' but I'm not sure...any ideas? Is there a way to test whether 'bwm-ng' is working correctly?

 

Thanks In Advance

Link to comment

I'm assuming this might have something to do with the implementation of 'bwm-ng' but I'm not sure...any ideas? Is there a way to test whether 'bwm-ng' is working correctly?

 

Thanks In Advance

It the server is not shutting down when you are watching movies, then the bwm-ng is probably working just fine.

 

If the server is shutting down when not watching movies, but when your media players are online, then either:

1.  You did not edit the line in the script to hold the IP addresses of your media players

or

2. Your media players do not respond to a ping command

 

The line in the script to be edited is:

pingIPs="192.168.1.40 192.168.1.45" # do not sleep if <$pingsIPs> are pingable

The IP addresses there must be those of your  media payers.

 

If they are, then you can test if they respond to a "ping" by typing:

ping -c 5 xxx.xxx.xxx.xxx

using the IP address of each media server.

 

Joe L.

Link to comment

Hi Joe L,

 

But if I'm watching a movie, the server HDD is spun up - therefore the countdown to sleep doesnt begin?....it just seems that the 'pingIP' part isnt working correctly and I was wondering how this links in with 'bwm-ng' and how it is configured? I should say that I stream movies straight from my server to my media player and dont play movies locally from the players HDD.

 

With reference to:-

 

(1) Yip dropped my IP's in the script.

and

(2) checked that they responded to ping...just to be sure I also had one media player switched on, the other switched off to verify that (a) I could ping them and (b) when off they were infact not 'pingable' (thus allowing the script theory of putting the server to sleep).

 

Not sure what it could be....everything else works like a dream...waking the server from media players on cold boot and from suspend... ???

Link to comment

This is interesting. I've been keeping quiet since my last post, because I didn't have anything conclusive to offer.

 

The fact is though that I am also still having trouble with the latest script versions (ReneV's) with going to sleep while connected and playing music. My last tweak to increase the bwm-ng average span did not correct the issue, as I had first thought. In fact, since then, I have experienced the server going to sleep while one of my drives was still spun up (or at least it should have been based on the unRAID timer setting and the time I started playing music).

 

As I wrote previously, it's quite difficult to troubleshoot this when the failures are relatively few and require a lot of time to duplicate.

 

I've carefully gone through all of ReneV's code and could not spot any flaw in the logic or syntax, but I'm only a novice at this. So the approach I have taken for now is to simplify things as much as possible. I have gone back to my last (apparently) trouble free script, which was before ReneV offered his enhancements and more structured code. It's working so far, but it's too early, based on how intermittent my past problems have been, to be certain of anything.

Link to comment

In case it needs saying, I'm keeping a keen eye on this thread and will revisit the latest version of the sleep script as soon as something looks actionable.

 

Personally, I have no problem with the functionality that's being discussed.

 

 

NB! If I remember correctly, I changed the script file from Windows to *nix format. (It was probably a mistake to not convert it back to Windows format before uploading it; sorry.) If you have issues, try looking at line-termination issues in your local copy of the script.

Link to comment
...NB! If I remember correctly, I changed the script file from Windows to *nix format. (It was probably a mistake to not convert it back to Windows format before uploading it; sorry.) If you have issues, try looking at line-termination issues in your local copy of the script.

 

Thanks Rene,

 

I think you're onto something. I found that somehow the version of your script that I had modified, and was using, had a LF terminating the "done" at the end of the script. Also the version that I uploaded on 01/18/10 not only had that extra LF, but also CR after every line.

 

I think these were all errors introduced by me.

 

Apologies to anyone affected.  :-[

 

I am attaching a cleaned up version of my modified script and will delete the earlier attachment.

s3_notHrHdTcpIp.txt

Link to comment

Starcat - im using 2 x Revo 3600 running XBMC Live 9.11.

 

ReneV / lewcass - apologies but Im a bit of a linux novice' when you say... 'Windows to *nix format'....what do you mean?

 

And please could you elaborate on..... "had a LF terminating the "done" at the end of the script. Also the version that I uploaded on 01/18/10 not only had that extra LF, but also CR after every line."

 

I have also used the 18/01/10 script, changed a couple of variables to suit my needs and copied across onto my server.

 

Hopefully this is the answer!!...any help most definately apreciated  :)

Link to comment

lewcass, is the script you just posted the regular s3 script that I might use (after customization of the custom section of course) in my environment? Thanks!

Yes. The only change from ReneV's script is an increase in the bwm-ng average span from 30 sec default to 120 sec. This change probably won't make any noticeable difference in practice, and if it does, should not be harmful.

 

Link to comment

ReneV / lewcass - apologies but Im a bit of a linux novice' when you say... 'Windows to *nix format'....what do you mean?

 

And please could you elaborate on..... "had a LF terminating the "done" at the end of the script. Also the version that I uploaded on 01/18/10 not only had that extra LF, but also CR after every line."

 

I'm far from the best person to answer this, that's why I was looking for an article in the wiki on scripting issues that I thought I remembered reading before answering. But I couldn't find it, so here's my meager understanding until someone who knows better can explain it better.

 

Basically IIRC linux and DOS/Windows treat text files differently in how each line is terminated. Windows uses a carriage return character, whereas linux uses a line feed. Having a carriage return at the end of a line in a linux bash script will normally mess things up. However there is a linux command  that will allow you to run a script with Windows formatting. Also IIRC there should never be a line feed or any other terminator at the end of the last line of the script. It should only contain done.

 

You can check for the presence of these characters and other invisible formatting characters using most text editors. e.g., in Notepad ++ you select View / Show Symbol.

Link to comment

quick question.....if i want the 'pingIP' section to work, does the 'checkTCP=$n'o need to be set to $yes ??

Yes, you do need to set the line to have it check the TCP/IP activity.

 

So, set the IP addresses AND set

# control of external timeout

checkTCP=$yes # check for TCP activity

Link to comment

quick question.....if i want the 'pingIP' section to work, does the 'checkTCP=$n'o need to be set to $yes ??

Yes, you do need to set the line to have it check the TCP/IP activity.

 

So, set the IP addresses AND set

# control of external timeout

checkTCP=$yes # check for TCP activity

 

Are you sure Joe? It looks to me as though the two routines are separate. I think all he needs to do for check_IP_status to run is to include the IP numbers.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.