Sporadic sleep behavior v6.1.9


Recommended Posts

Hi Guys,

 

I've got my unraid server setup to sleep when inactive and wake up when I ping it. I've been using it like this for a while and  it all works but...

 

It sometimes doesn't go to sleep despite every other device in the house that connects to it being turned off. It does this about 30% of the time even when there is no parity check going on. Additionally, it very occasionally goes to sleep when I'm in the middle of using it.

 

I'm not sure why this is but I'd love to have it go to sleep consistently when it's not doing anything. The s3.sh script I've got saved in custom/bin is below and is something I've copied from google searches. Any help would be greatly appreciated :)

 

#!/bin/bash
drives="/dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg"
timeout=10
count=10
while [ 1 ]
do
 hdparm -C $drives | grep -q active
 if [ $? -eq 1 ]
 then
  count=$[$count-1]
 else
  count=$timeout
 fi
 if [ $count -le 0 ]
 then
  # Do pre-sleep activities
  sleep 5
  # Go to sleep
  echo -n mem > /sys/power/state
  # Do post-sleep activities
  # Force NIC into gigabit mode
  # (might be needed forgets about gigabit when it wakes up)
  ethtool -s eth0 speed 1000
  # Force a DHCP renewal (shouldn't be used for static-ip boxes)
  /sbin/dhcpcd -n
  sleep 5
 count=$timeout
fi
 # Wait a minute
 echo COUNT $count
 sleep 60
done

Link to comment

Hi Squid,

 

As far as I can tell they are. There are no devices that normally connect to it switched on. The only thing I can think of is my tplink c3200 router that I leave on 24/7. Can you think of any troubleshooting ideas I can try?

Link to comment

Hi guys,

 

This extra info may help: In the unraid disk settings, I set the default spin down delay to 15mins and in the s3.sh script, I set the timeout and count to 1.

 

When I reboot the server, and manually spin down the drives, it goes to sleep after 1min.

 

When I reboot the server, and wait 15mins for the drives to spin down, it goes to sleep 1min later.

 

However, when I wake the server from sleep, it won't go back to sleep, no matter how long I wait even though all drives are spun down.

 

Also, my go script looks like this:

 

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

ethtool -s eth0 wol g

# Execute s3.sh sleep script
fromdos < /boot/custom/bin/s3.sh | at now + 1 minute

 

Any ideas?

 

Edited by hat22
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.