Results 1 to 10 of 50

Thread: Server auto-suspend?

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Beans
    35

    Question Server auto-suspend?

    Hi guys,

    Have been searching quite a bit and found many similar questions, but no answers so far...

    I have a home server running ubuntu. With emphasis on home, it really doesn't need to be running all the time. Hence I would like it to suspend, when not in use, and wake up when needed (just like a commercial NAS or home server).

    So far I can:
    - Suspend with 'pm-suspend'.
    - WOL from another computer.
    - WOL from a squeezebox.

    So far so good, but now I would like to:
    (1) Auto-suspend when not in use.
    (2) Wake up when I try to access my network drive from another computer (windows).

    I am sure that (1) can be done, but how?
    The desktop version of ubuntu has some kind of auto-suspend, right?

    As for (2), I think, it could depend on my ethernet adaptor (wake on traffic to ip...?), but I not sure?

    The system is an Intel D945GSEJT.

    ~Frank

  2. #2
    Join Date
    Nov 2009
    Beans
    27
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Server auto-suspend?

    Hey

    I think we are working toward the same thing:

    http://ubuntuforums.org/showthread.php?t=1335126

    My system wakes no problem when I pick up the Duet Remote but it doesn't when I access a Samba from my desktop but I'm still to properly investigate this.

    Up till now I was assuming I could use the Gnome Power Management util to shut down the system when not is use but I've just found out it uses the screensaver util to trigger a suspend action and the problem with screensaver is that is only monitors user input ie mouse and keyboard not the activity of apps or shared folders.

    The solution for us I think is some kind of util to watch a number of nominated apps and then perform an action after a certain timeout.

    btw do you get me on the suspend then hibernate requirement ?

  3. #3
    Join Date
    Sep 2009
    Beans
    35

    Re: Server auto-suspend?

    Quote Originally Posted by inspiral View Post
    I think we are working toward the same thing:
    http://ubuntuforums.org/showthread.php?t=1335126
    Yeah, and I have seen others with the same request, but no solution yet. A bit strange, I think.

    Quote Originally Posted by inspiral View Post
    My system wakes no problem when I pick up the Duet Remote but it doesn't when I access a Samba from my desktop but I'm still to properly investigate this.
    The Squeezebox sends a WOL to the last server it was connected to. I don't think windows will do this, when trying to connect to a computer on the network - but it should if it was up to me

    Quote Originally Posted by inspiral View Post
    Up till now I was assuming I could use the Gnome Power Management util to shut down the system when not is use but I've just found out it uses the screensaver util to trigger a suspend action and the problem with screensaver is that is only monitors user input ie mouse and keyboard not the activity of apps or shared folders.
    Damn, I was thinking; "when it can be done in the desktop version, of cause it can be done on a server", but I guess I was wrong.

    Quote Originally Posted by inspiral View Post
    The solution for us I think is some kind of util to watch a number of nominated apps and then perform an action after a certain timeout.
    Ok, who will write this? I'll be happy to test it

    Quote Originally Posted by inspiral View Post
    btw do you get me on the suspend then hibernate requirement ?
    Yeah, I get your idea, and I think there is hope if the hardware supports it (and we can get the other problems sorted).
    Check out: http://blog.dustinkirkland.com/2009/...ateresume.html
    and the script: http://people.canonical.com/~apw/sus...e/test-suspend
    It suspends the system and wakes it up after a fixed period of time. Hence you could make a script to
    - suspend
    - wake up after x min
    - hibernate
    - if woken up before x min -> break script
    Like blazemore suggests in your other thread (http://ubuntuforums.org/showthread.php?t=1335126)
    But I know nothing about scripting - yet

    ~Frank

  4. #4
    Join Date
    Nov 2009
    Beans
    27
    Distro
    Ubuntu 13.10 Saucy Salamander

    Question Re: Server auto-suspend?

    >>Yeah, and I have seen others with the same request, but no solution yet. A bit strange, I think.

    tbh I'm rather disappointed by the power management built into Ubuntu, what we're looking for seems such an obvious requirement for a home server

    Anyway enough of the moaning and back to solving the problems.

    To solve the WOL from a Windows box I:

    • Downloaded www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx
    • Put the full command line required into a batch file
    • Added a shortcut to the Desktop
    • Then dble click the shortcut, wait a bit and then access the network drive

    Not exactly elegant and manual(boo) but it works.

    This leave the more fundamental issues:

    • Monitoring the system is being accessed or serving tune via Squeezebox and then triggering an event if not
      • This is the difficult one, you could ether monitor specific processes via Top or another similar tool or maybe monitor the use of the network port

    • Going to Hibernate from the Suspend state if the system remains un-accessed
      • This is easier, the script you point out has the command line syntax required to Suspend for a period of time then to come back up and do something else: http://people.canonical.com/~apw/sus...e/test-suspend
      • Not sure how you get it to recognise if it came up of it's own accord or by WOL/pwr_button


    I'm afraid on the scripting front I'm pretty hopeless, I gave if up a long time ago for just that reason

    I guess we could raise this subject on the Squeezebox forum but would've though this is fairly generic functionality.

    Thoughts Frank/anyone ?
    Last edited by inspiral; December 10th, 2009 at 11:45 AM.

  5. #5
    Join Date
    Sep 2009
    Beans
    35

    Re: Server auto-suspend?

    Quote Originally Posted by inspiral View Post
    Monitoring the system is being accessed or serving tune via Squeezebox and then triggering an event if not.
    This is the difficult one, you could ether monitor specific processes via Top or another similar tool or maybe monitor the use of the network port
    Yes this is indeed the tricky one. Any help would be greatly appreciated.

    Quote Originally Posted by inspiral View Post
    Going to Hibernate from the Suspend state if the system remains un-accessed
    I am sure, we can solve the suspend->hibernate problem, once we have solved the auto-suspend problem, so let's concentrate on the later.

    ~Frank

  6. #6
    Join Date
    Nov 2009
    Beans
    27
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Server auto-suspend?

    I thought this tool might offer something that would allow us to use the Screensaver trigger as it can activate dynamically when a process starts:

    http://www.blastfromthepast.se/caffe...itle=Main_Page

    But the problem is the Squeezbox is a sever that starts when you boot bot just when you start the tool meaning Caffeine triggers all the time never letting the system go to sleep unless you artificially kill the SB service.

    Better look for something else I suppose....

  7. #7
    Join Date
    Dec 2007
    Beans
    7

    Re: Server auto-suspend?

    Hi

    I tried sleepd, and it works quite nice.
    I simply set it up to suspend if the network activity goes below 20 packet/s
    This threshold is useful because you may have a browser having tcp connections with very few packets.
    It works very well.

    But, I haven't found how to tell it to monitor video players or screensaver. (as video players disable screen saver)
    powernap doesn't seem to have the network monitoring threshold feature.
    Monitoring the server load doesn't seem very robust, as a browser can use cpu for animations for example.

    If someone has a good solution for suspending a home server, not during video playback (player or flash player in browser...) that would be nice.

    I thought about a monitoring process looking at the screensaver.
    Computer can go to sleep if network activity is low and screen dpms is shutdown (monitoring xset q?)
    sleepd can be controled with sleepctl on or off only.

  8. #8
    Join Date
    Apr 2010
    Beans
    3

    Re: Server auto-suspend?

    Hi,

    I still use powernap and it works very well for me. I monitor afpd (when no drive is mounted over the network, server goes to sleep). I haven't figured out yet, how to configure it for smbd though. But since I mainly use Macs within my network this is a working solution.
    Before this approach I monitored ssh. So when I needed the server to "stay alive", I opened up a ssh-session. Closing it leaded to send the server to sleep.

    Cheers
    wanky

  9. #9
    Join Date
    Feb 2011
    Beans
    12

    Re: Server auto-suspend?

    I started to use powernap some weeks ago and I have problems in same machines with USB keyboards & USB mouses.

    Please see my comments at https://bugs.launchpad.net/ubuntu/+s...ap/+bug/872109

    Any idea?

    Josep Pujadas-Jubany
    Last edited by bellera; February 27th, 2014 at 07:22 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •