Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sporadic sleep behavior v6.1.9

Featured Replies

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

I can't answer your specific question as I don't sleep my servers. However, version 6.1.9 is long out of date. The current version of Unraid is 6.7.0. You might want to consider upgrading, if only for the security updates.

  • Author

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?

  • Author

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

Does those set in cron job or run again periodic, seems they will execute only once.

Edited by Benson

  • Author
14 hours ago, Benson said:

Does those set in cron job or run again periodic, seems they will execute only once.

I'm not sure to be honest Benson.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.