prevent suspend / hibernate when streaming
J
dreadpiratejeff at gmail.com
Thu Feb 18 02:02:55 UTC 2010
On Wed, Feb 17, 2010 at 07:02, Johnneylee Rollins
<johnneylee.rollins at gmail.com> wrote:
>> i want it to suspend so that i'm not wasting power when i don't use it, but
>> i also want it to remain alive while i am remotely logged in or streaming.
>> How can i achieve this?
> I can envision a script to check to see if every process is sleeping
> and if any ssh sessions or streaming programs. You can even forget the
> last part. But the problem is, I don't know if you can bring a
> computer back from hibernation in a software manner.
>
> You couldn't start a new session if your server hibernated.
Seems that the simplest thing to do, building on what Johnneylee said,
would be something to monitor for active streaming. I have no idea
how you're streaming, or what you're streaming with, but perhaps
something to monitor whatever port is being used for your streamer,
set to check for activity every so often and if no traffic for that
port is seen in $TIME execute a pm_suspend.
Checking to see if everything is sleeping would not work, because
there's always something that's not in a sleep state:
for example, the very program you're using... unless it was a cron job...
Or something like that.
However, the problems I see with a simple script is that once the
pm_suspend is initiated, it can't be stopped and once suspended, as
Johnnylee points out, you cant start a new session... without doing
something like a wake-on-lan to bring the system back up before
initiating the new stream session.
I don't think this would really be a "simple" script in any case. In
theory, yes, but in application, probably not.
--
Mike Ditka - "If God had wanted man to play soccer, he wouldn't have
given us arms." -
http://www.brainyquote.com/quotes/authors/m/mike_ditka.html
More information about the ubuntu-users
mailing list