Results 1 to 6 of 6

Thread: 'Stay awake' functionality for server

  1. #1
    Join Date
    Jul 2008
    Location
    Manchester. UK
    Posts
    43

    Default 'Stay awake' functionality for server

    Hello

    I am running Opensuse 11.1 on a mini home server, with a maximum of two client PCs. For 18 or more hours a day, neither client is connected. I would really like some way of having the server run only when needed, and sleep the rest of the time.

    I've implemented WOL to get the server woken up with no problem, but I would like some mechanism to keep the server awake only when one or more of the clients is connected. Is this a simple thing to do? Could some process intermittently check to see if a client is connected, and put the server to sleep if not? Is that a simple thing to implement ? (I'm not very experienced at scripting). Is there a better / more obvious way to do it?

    Thanks for any suggestions or pointers

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'Stay awake' functionality for server

    You don't say what kind of server. Samba server, web server, ftp server?

    If Samba server you could periodically check the output of smbstatus to see if there are any connections.

  3. #3
    Join Date
    Jul 2008
    Location
    Manchester. UK
    Posts
    43

    Default Re: 'Stay awake' functionality for server

    Quote Originally Posted by ken_yap View Post
    You don't say what kind of server. Samba server, web server, ftp server?

    If Samba server you could periodically check the output of smbstatus to see if there are any connections.
    Samba server. So, is it easy to do this with a script? Apologies if this seems obvious!

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'Stay awake' functionality for server

    Take the output of smbstatus and look for any connected clients. If none, then the server can be shutdown.

  5. #5
    Join Date
    Jul 2008
    Location
    Manchester. UK
    Posts
    43

    Default Re: 'Stay awake' functionality for server

    Thanks for your response. And if clients are still connected, do you know how I can reset the 'machine idle' (ie no keyboard/mouse activity) timer to zero? Is this maintained by the desktop or by X-windows?

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'Stay awake' functionality for server

    Don't really know. Maybe you can poke the X server using the xset program.

Tags for this Thread

Posting Permissions

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