Jump to content

Powerdown after certain time of inactivity


schark

Recommended Posts

Hello,

 

my unraid server has been up and running now for a long time now and I am very confident. It exactly does what I want. Clean and easy.

I used the search function for topic 2.) and also googled but did not find proper solutions.

 

Now comes the part to tune a little bit. The unraid box is in the basement. All the time I need to go to the basement to start unraid (by pushing the power button) and later to shut it down via the web-gui.

 

What I want to do is the following:

 

1.) Start the unraid box using my iphone (not done any researches about that yet).

 

2.) and right now important: Automatic powerdown of unraid after a specified time of inactivity. (E.g. I watched a movie and there has been no read or write access anymore to the server for 40 minutes, then power down).

 

Is that possible with V4.7 (stable) or is it possible with upcoming V5

 

Only solution I found with the forum search is the scheduled shutdown at e.g. 11:00 pm. But if I understood correctly is that this will force a shutdown even if I am watching a movie from the server.

 

Is that even possible?

 

Link to comment
  • 2 weeks later...

I suppose that nobody asked that before. Okay, then I will take care about step one now (as soon as my new iphone arrives here).....

 

I already googled for finding a possible solution of point 2.), but so far no luck.

If anybody knows how to achieve that I will really appreciate a link or instructions what I need to do.....

 

Cheers!

Link to comment

I wanted to do this as well. I built an unRaid for a relative and they never use it because it's "always off".

They just got an iPhone so that seemed like the most convenient method to wake the unRaid from sleep mode.

 

After trying a couple Wake on Lan apps I settled on NetAwake. It's free and was the cleanest, simplest.

Simply enter the MAC address of your unRaid. From then on just press the name of the server then press Wake and it starts.

 

It's a bit trickyer to put it back to sleep. As I recall there was much discussion last year about the best approach.

Seems there was no true method to determine when it was safe to turn off automatically after inactivity. Maybe that's changed in newer versions I don't know.

 

My workaround was to use another iPhone app called Mocha Telnet Lite. Also free.

Configure it to log on via telnet to your unRaid box.

Under the Macro button create a macro with the following code:

 

echo 3 > /proc/acpi/sleep#R

 

That's it.

To put your server to sleep just open MTL > Connect > unRaid server > Enter (or unRaid password if you set one) > Menu > Macro 0 > Menu > Disconnect

It seems like a lot of steps, I wish it was just one button, but it's really easy after doing it a couple times.

 

Link to comment
  • 4 weeks later...

I wanted to do this as well. I built an unRaid for a relative and they never use it because it's "always off".

They just got an iPhone so that seemed like the most convenient method to wake the unRaid from sleep mode.

 

After trying a couple Wake on Lan apps I settled on NetAwake. It's free and was the cleanest, simplest.

Simply enter the MAC address of your unRaid. From then on just press the name of the server then press Wake and it starts.

 

It's a bit trickyer to put it back to sleep. As I recall there was much discussion last year about the best approach.

Seems there was no true method to determine when it was safe to turn off automatically after inactivity. Maybe that's changed in newer versions I don't know.

 

My workaround was to use another iPhone app called Mocha Telnet Lite. Also free.

Configure it to log on via telnet to your unRaid box.

Under the Macro button create a macro with the following code:

 

echo 3 > /proc/acpi/sleep#R

 

That's it.

To put your server to sleep just open MTL > Connect > unRaid server > Enter (or unRaid password if you set one) > Menu > Macro 0 > Menu > Disconnect

It seems like a lot of steps, I wish it was just one button, but it's really easy after doing it a couple times.

 

 

In the meantime I tested the two apps on my iphone. The Telnet app to send the server to sleep works perfectly. However with NetAwake I have an issue.

 

It only works once to wake up unraid box. Meaning I start the server manually (power button on) then I send it to sleep then I use NetAwake and it works.

Next time I send the server to sleep using telnet macro, server goes to sleep. But WOL does not work anymore. I do not know why.... I also tested another WOL app, but no success.

 

In BIOS I only had the choice for "Suspend to RAM" or Disable, nothing like S1 or S3 state and a feature named Ring-in to power on. I assume that this is WOL functionality. My mainboard is a Asrock A780GM-LE by the way.

 

If I type ethtool eth0 the entry wake-on states "g" and "Supports Wake-on" states pumbg.

 

Does anybody know how to fix that?

Link to comment

It won't matter which WOL app you use. They all send the same "magic packet" out to the network. Only their UI's will differ.

 

Suspend-To-RAM is S3. Make sure that is enabled in BIOS.

Sounds like your board settings are capable of WOL. I have a different MB but the same settings. I'd try testing with a different OS to see if it works.

When you go to Standby and can't wake it, are the LAN card status lights still on and occasionally blinking?

 

On the subject of Mocha Telnet Lite, I've tweaked my method so it's even easier now. Here's what I did:

 

In an unRaid telnet session type:

 

passwd -d root

 

This will remove the password prompt from unRaid when connecting via Telnet. (where you normally press ENTER on a stock unRaid)

 

In the MTL Configure Settings there's an option to Automatically Connect when the app starts. Set that to ON.

Now when you start MTL it will auto login and you only need to press the Macro button to Standby unRaid.

 

[glow=green,2,300]Update: Success!  I've figured out how to make unRaid standby with one touch![/glow]

 

First, do as mentioned above to remove the unRaid password prompt and set MTL to Automatically Connect.

Second, in MTL Configure Settings, change the "Search for password" string to:  "# "  (That is just a number sign followed by a white space, NO QUOTES.)

Finally, in MTL set the password to:  echo 3 > /proc/acpi/sleep

Type carefully as the iPhone will obscure the text you enter. Also, don't put the #R as mentioned in my earlier post, that's only if using a macro. Since we aren't using a macro it's not needed.

 

Now when you tap on the MTL app it will automatically connect and send the standby code. MTL thinks the code is your password and since we have unRaid go straight to the prompt (# ), it will execute the code.

 

-PCRx

Link to comment

Okay, if every WOL application sends the same magic packet then it does not matter.

 

But then I have the issue that Waking up the server works only the first time after the server got booted. Second wake up does not work.

 

Do you think it will be better with version 5 (when it is final). Right now I am using 4.7

 

@PCRx

Will try your MTL procedure later at home (today my wife is going out with friends).

Link to comment

I understand your issue but have you tested with another OS as requested? If it doesn't work with another OS, it probably rules out unRaid begin the problem.

My guess is you have some issue with your motherboards NIC or your router.

 

Maybe your router is flushing it's ARP table and forgetting where your unRaid server is. Try setting a static IP address for your unRaid server in your router.

 

-PCRx

Link to comment
  • 3 months later...

Yesterday, I updated to V5 beta14 and somehow my sleep command "echo 3 >/proc/acpi/sleep" does not work anymore.

 

I checked already the Wiki, but there is nothing mentioned. Is it really different between V4.7 and V5.0 beta14 due to different LINUX kernels or something?

Link to comment
  • 3 weeks later...

Yesterday, I updated to V5 beta14 and somehow my sleep command "echo 3 >/proc/acpi/sleep" does not work anymore.

 

I checked already the Wiki, but there is nothing mentioned. Is it really different between V4.7 and V5.0 beta14 due to different LINUX kernels or something?

yes
Link to comment

Archived

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

×
×
  • Create New...