Looking for better ideas how how to sleep/suspend my unraid box


Recommended Posts

I do not get the screen back; this means: the box is alive, I can telnet to it, but the physical monitor does not show the console anymore. Any hints how to solve this?

 

Sometimes there is a bios option to re-initialize the video bios after returning from sleep.

You can check your bios and toggle the option to see if this helps.

Link to comment

Install and use s2ram instead of using "echo mem > /sys/power/state"

Sorry to be such a noob, but which version of s2ram should I get. I understand unRAID is built off Slackware, but I don't see that listed on the s2ram page. I saw a mention from a forum post somewhere that they got s2ram from slacky.eu. Unfortunately, that page is in Italian.

 

EDIT:

Okay I searched for the "Suspend" package on the slacky.eu page and it led me to http://suspend.sourceforge.net/. Is that the correct package? I'm off to go read up on how to install it now.

 

EDIT2:

Okay so I renamed suspend-0.8.tar.gz (from the sourceforge link above) to suspend-0.8.tgz and from /boot I executed:

installpkg suspend-0.8.tgz

Then I tried to execute:

s2ram

and got:

s2ram: command not found

I'm guessing it's either the wrong package or I did not install it properly. As a side note it appears there are no "removepkg" or "pkgtool" commands available.

 

Link to comment
Okay so I renamed suspend-0.8.tar.gz

 

Nooooo...... 

 

There is no package for s2ram.... what you downloaded was the source code.  You have to compile it.... and for that you need a dev system, or at least a BUNCH of packages (and more than 512MB RAM if doing it under unRAID) in order to compile source.

Link to comment

Okay so I renamed suspend-0.8.tar.gz

 

Nooooo...... 

 

There is no package for s2ram.... what you downloaded was the source code.  You have to compile it.... and for that you need a dev system, or at least a BUNCH of packages (and more than 512MB RAM if doing it under unRAID) in order to compile source.

After looking thru the file I thought it might be source code, but I wasn't sure since my knowledge of Linux is still very minimal. Oh well. I guess I'll just sit back and wait a little longer. Thanks for the input.
Link to comment

Install and use s2ram instead of using "echo mem > /sys/power/state"

Didn't find an installable s2ram - bit I found and installed acpitool - usind acpitool -s (found that somewhere else here in the forum). Is this the same as s2ram?

Package installed: acpitool-0.4.7-i486-1goa

The behaviour doesn't change, same like using the echo command

Thanks, Guzzi

Link to comment

I do not get the screen back; this means: the box is alive, I can telnet to it, but the physical monitor does not show the console anymore. Any hints how to solve this?

 

Sometimes there is a bios option to re-initialize the video bios after returning from sleep.

You can check your bios and toggle the option to see if this helps.

No, there is no such option - checked this before posting here...

Link to comment

Is this the same as s2ram?

 

No.  s2ram has custom parameters for hundreds of mobos built into it, as well as additional command line parameters for special handling of ACPI and video quirks of a mobo.

 

ok, understand - so this could help reinitializing the videocard for display.

So I will wait if someone can compile a package for unraid - as I understood this is currently not available.

 

@cricker: No, but google for it, can be found quickly (that's the way I did it)

Link to comment
  • 3 weeks later...

Here's an updated version -- this one you'd have to background from the go script rather than cron-launch. 

 

Hi,

I modified the script to check if there is any htpc left running and this works fine. I inserted commands in the go script - this blocks my console.

So: How do I "background" it ("launch as separate script in background"?) to keep my console free?

Sorry for the silly question, but I am completely unexperienced with shell scripts...

tnx,

Guzzi

Link to comment

Here's an updated version -- this one you'd have to background from the go script rather than cron-launch. 

 

Hi,

I modified the script to check if there is any htpc left running and this works fine. I inserted commands in the go script - this blocks my console.

So: How do I "background" it ("launch as separate script in background"?) to keep my console free?

Sorry for the silly question, but I am completely unexperienced with shell scripts...

tnx,

Guzzi

nohup your_script_name &

 

nohup allows it to keep running after you log off the console, the "&" puts it in the background.

 

As an alternative, you can do this:

cd folder_that_has_your_script

echo "your_script_name" | at now + 1 minute

 

Joe L.

Link to comment
  • 2 weeks later...

OK - I'm able to put my server to sleep using the: echo 3 > /proc/acpi/sleep command.  Wakes up via magic packet.  So far, so good.

I've fiddled around with my go script and tried to implement OMV's script to force sleep after a set period of drives being spun down.

 

This exercise just served to reinforce how little I really know about linux, scripts, etc.

 

Anybody that has this working successfully willing to share what exactly is in their go script and, if there is a separate script for OMVs routine (or similar), how that is generated, where it is stored, etc? 

 

Many (many) thanks in advance!

 

 

Link to comment

OK - I'm able to put my server to sleep using the: echo 3 > /proc/acpi/sleep

Is that the actual command you typed? I've tried all sorts of commands that looked similar, but that exact one doesn't look familiar. Which build of unRAID did you use that with, and do you have and mods to it?
Link to comment

OK - I'm able to put my server to sleep using the: echo 3 > /proc/acpi/sleep

Is that the actual command you typed? I've tried all sorts of commands that looked similar, but that exact one doesn't look familiar. Which build of unRAID did you use that with, and do you have and mods to it?

 

Yes, if I telnet into the tower and type:  echo 3 > /proc/acpi/sleep

my machine goes to sleep.  Works very well, actually.  I gleaned this command from this thread. 

I'm not sure WHY it works, of course - which is what makes everything so frustrating.  I do try to understand things as I try to implement them, so that I am learning as opposed to just typing.  But I haven't even been able to decipher the first part of this:  'echo 3' !

 

Anyway, using unRAID 4.4 on a Foxconn A7GM-S motherboard.

Link to comment

That does help a bit.  Essentially you are using the 'echo' command to "apply" a value of 3 to /proc/acpi/sleep . . . I guess.

 

What I've done so far is taken OMV's updated bash script that is designed to suspend the machine after a preset period of spindown time, and created a file called s3.sh, using wordpad, that contains OMV's script.  Then I try to call that file from the go script using nohup, but it doesn't work.  I get: "No such file or directory".

 

 

I suspect that I'm missing something very basic in the process of creating a useable script file.

Link to comment
  • 1 month later...

That does help a bit.  Essentially you are using the 'echo' command to "apply" a value of 3 to /proc/acpi/sleep . . . I guess.

 

What I've done so far is taken OMV's updated bash script that is designed to suspend the machine after a preset period of spindown time, and created a file called s3.sh, using wordpad, that contains OMV's script.   Then I try to call that file from the go script using nohup, but it doesn't work.  I get: "No such file or directory".

 

 

I suspect that I'm missing something very basic in the process of creating a useable script file.

You should make the script executable:

chmod +x [filename]

.

Link to comment

I suspect that I'm missing something very basic in the process of creating a useable script file.

When the "go" script is being run, the current working directory is probably "/" and the file you are trying to invoke is not in the search path.

 

Try using either a full path to the script

nohup /boot/whatever/s3.sh &

 

or change directory to it first, and then use "nohup ./s3.sh"

cd /boot/whatever

nohup ./s3.sh &

Link to comment

Is the current directory not on the search path in Linux?

 

???

 

Not normally, at least not before /etc/profile is run, and usually never for the "root" user to prevent abuse (although Tom has edited /etc/profile to add it, even for root). 

 

Since no login has occurred when the "go" script is being invoked, it is not using /etc/profile at all.

 

 

Link to comment
  • 2 weeks later...

OK - it's been a long and frustrating effort, but I've finally got unRaid sending me email alerts if the system goes offline.  AND . . . it's reliably sleeping after spindown and waking up via magic packet!  I consider these two functions to be key to any respectable home server system so I really wanted to get both working.

 

After it was working, the next challenge was making the WOL function a little more wife friendly.  She couldn't be expected to jump through many hoops to wake the server up if she needed to access her files from her laptop.  I found a windows command line tool called wolcmd that works great from a .bat file to send the magic packet. 

 

http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx

 

Instructions for use are on the site.  Basically the .bat file is a two-liner (could be a one-liner probably), first change to the directory where wolcmd.exe is stored, then call it along with your server mac address, ip address, and subnet mask.  Pretty straighforward.

Now I have an icon on the wife's laptop called "Wake Server" that she can just double-click if the server is not online.

 

I hope this might help someone.  I'll see if I can add a link to the wiki for the wolcmd tool.

 

agw

Link to comment

OK - it's been a long and frustrating effort, but I've finally got unRaid sending me email alerts if the system goes offline.  AND . . . it's reliably sleeping after spindown and waking up via magic packet!  I consider these two functions to be key to any respectable home server system so I really wanted to get both working.

 

After it was working, the next challenge was making the WOL function a little more wife friendly.  She couldn't be expected to jump through many hoops to wake the server up if she needed to access her files from her laptop.  I found a windows command line tool called wolcmd that works great from a .bat file to send the magic packet. 

 

http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx

 

Instructions for use are on the site.  Basically the .bat file is a two-liner (could be a one-liner probably), first change to the directory where wolcmd.exe is stored, then call it along with your server mac address, ip address, and subnet mask.  Pretty straighforward.

Now I have an icon on the wife's laptop called "Wake Server" that she can just double-click if the server is not online.

 

I hope this might help someone.  I'll see if I can add a link to the wiki for the wolcmd tool.

 

agw

 

Hey congrats on the S3 mode.

 

This is something I would like to be able to achieve.  Is it possible you could detail exactly how you achieved this?

 

Do all the drives spin up when you wake it up?

 

Can a magic packet be sent by an xbox (Original using xbmc)??

 

Appreciate any help and thx.

 

 

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.