hat22 Posted May 24, 2019 Share Posted May 24, 2019 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 Quote Link to comment
John_M Posted May 24, 2019 Share Posted May 24, 2019 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. Quote Link to comment
Squid Posted May 25, 2019 Share Posted May 25, 2019 Are you sure your drives are idle?Sent via telekinesis Quote Link to comment
hat22 Posted May 25, 2019 Author Share Posted May 25, 2019 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? Quote Link to comment
hat22 Posted May 29, 2019 Author Share Posted May 29, 2019 (edited) 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 May 29, 2019 by hat22 Quote Link to comment
Vr2Io Posted May 29, 2019 Share Posted May 29, 2019 (edited) Does those set in cron job or run again periodic, seems they will execute only once. Edited May 29, 2019 by Benson Quote Link to comment
hat22 Posted May 29, 2019 Author Share Posted May 29, 2019 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. Quote Link to comment
Recommended Posts
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.