Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About DisplayNerd

  • Rank
  1. DisplayNerd

    Standby and resume

    My board doesn't support s3 sleep either. The best you can do is echo -n shallow > /sys/power/mem_sleep # Then do echo -n mem > /sys/power/state Probably too late though.
  2. Thanks everyone for the help. EDIT: Stopping the array pauses the script until the array stops, so there is no script needed to check for the array to stop!
  3. Just learned a little PHP. If the end result can take fewer lines or there's errors in my script, please feel free to edit it. I'm a total noob. Add on to Squid's script: $file = "file location"; $handle = fopen($file, "w"); fwrite($handle, "Execute"); fclose($handle); Script to check if executed by user or sleep script after array stop: #!/usr/bin/php <? $file = "file location"; $output = file($file); $start = FALSE; foreach($output as $line) { if(strcmp($line, "Execute") == 0) { $start = TRUE; } } if($start == TRUE) { $handle = fopen($file, "w"); fwrite($handle, "DontExecute"); fclose($handle); exec("bash ./[Location of script]/sleepscript.sh"); } ?> Still don't know best place to save file.
  4. Correct me if im wrong (i don't know any PHP but i have programmed before) but it seems Squid's script for stopping down the array shuts it down as if you clicked the stop button from the browser. I would assume you'd have to pass data (like a boolean value saved in a file whether the stop script was executed or not) from one script to the next if using the event system would be the path you took. And as I've said before, I don't know any PHP (though this does seem like a pretty simple feat). I'll see if i can find any vids that teach you if statements and saving flies in PHP. P.S. Where would be a good place to store one such file? Somewhere in /tmp I presume. Can you do this without saving a file?
  5. Yeah. Should've thought about that
  6. Thanks squid and bonienl. So I think what would be best would be to make a script to stop the array when the disks spin down using squid's PHP. Then make another script that uses the event system in unraid bonienl suggested to put the array in sleep. Is there an unraid event state that the disks have spun down as well?
  7. Thanks guys! Is 15 seconds good? So, just to be clear /mnt/user will disappear after the array stops. Right?
  8. Thanks Squid for your help, and thank you bonienl for the suggestion. I doubt the S3 sleep plugin is supported on my system as cat /sys/power/mem_sleep only prints s2idle and standby. Not deep as s3 sleep would give (and visual conformation, my server didn't turn off when I put it to sleep when I used it as an actual computer for a little while). I was thinking to write "standby" to /sys/power/mem_sleep and then write "mem" to /sys/power/state. P.S. Does anyone a way you could check the state of whether the array is fully stopped so I can sleep when the operation is complete? I don't really care if the drives spin up after the array stops, putting it in sleep spins them down again, I think.
  9. I've been wanting to make a script to put my server to sleep when not using it and want to stop the array after the drives have spun down (for extra security) and then put the server to sleep. I kind of know how to put it to sleep and find out if the drives have spun down as there's threads on that, but I can't find out how to stop the array through the terminal. Anyone can help me?