User: Password:
|
|
Subscribe / Log in / New account

Yet another opportunity for opportunistic suspend

Yet another opportunity for opportunistic suspend

Posted Oct 20, 2011 13:57 UTC (Thu) by intgr (subscriber, #39733)
Parent article: Yet another opportunity for opportunistic suspend

Not sure if this is useful for smartphones/Android, but I definitely want a "suspend policy" daemon on my desktop and laptop computers.

Session managers already do something similar for screen savers (though that's in user's session scope, not global). Also desktop environment developers have introduced lots of new odd daemons recently, I'm surprised they haven't came up with a suspend policy framework yet.

I've currently set all my computers to suspend after 1 hour of inactivity which works great, but I'd like to block suspend when I'm just using my computer to play music and not otherwise using the computer. Also, I want to suspend my laptop, but not when I have music playing. This seems impossible to do for now and makes opportunistic suspend quite annoying. Also I don't want my laptop suspending when I'm listening to music and just close the lid. I just want the screen to shut off its backlight.

So music players could come with a checkbox "[x] Block suspend while playing music" and my BitTorrent client could have "[x] Block suspend until downloads have completed"

Combined with wake-on-LAN, I see this could even be useful for home servers (e.g. NAS) to save power while everyone is asleep.


(Log in to post comments)

Yet another opportunity for opportunistic suspend

Posted Oct 20, 2011 16:30 UTC (Thu) by yokem_55 (subscriber, #10498) [Link]

Apple's Wifi routers and their desktops have a feature called wake-on-demand, that will send the requisite wake-on-lan packet to a sleeping machine when a bonjour published service is accessed. So, in theory your system could sleep until you want to ssh into it, and then the router, detecting the attempted access to the sleeping system, sends then wake on lan packet to the system allowing your ssh connection to proceed. Sadly this feature has been an Apple only thing, and while Apple has the source for it's implementation available (it's deeply tied into Darwin's packet filtering), it hasn't gotten any real attention in the Openwrt and related communities.

Yet another opportunity for opportunistic suspend

Posted Oct 20, 2011 22:23 UTC (Thu) by kirkland (guest, #53307) [Link]

The PowerNap project/package in Ubuntu provides exactly the kind of policy manager you're talking about. It was designed to be sort of a "screensaver for servers, except saving power instead of the screen", but it works just as well on desktop and laptops. I know LWN and its readers love to hate Ubuntu/Canonical/Launchpad, but in case you're curious, see: http://launchpad.net/powernap.

Cheers,
Dustin

Yet another opportunity for opportunistic suspend

Posted Oct 20, 2011 22:42 UTC (Thu) by jake (editor, #205) [Link]

> I know LWN and its readers love to hate Ubuntu/Canonical/Launchpad

wow, sorry you feel that way. I *know* it's not true for LWN, and I don't really think it's true for our readers either. There are some vocal critics without a doubt, but "love to hate" seems a bit over the top to me.

YMMV,

jake

Yet another opportunity for opportunistic suspend

Posted Oct 21, 2011 13:52 UTC (Fri) by kirkland (guest, #53307) [Link]

Okay, Jake, you're right -- my comment was inappropriate. I was in a bit of bad mood when I wrote that. My apologies.

Anyway, a friend linked me to this interesting article about opportunistic suspend and suggested that I link PowerNap in as a pertinent tool. I should have did just that and left the criticism to others. Sorry.

Yet another opportunity for opportunistic suspend

Posted Oct 21, 2011 4:16 UTC (Fri) by Darkmere (subscriber, #53695) [Link]

There is some commentary about that package and the dubious value of how good it actually is. Since we're not seeing enough inflammatory comments about Canonical/Ubuntu/Launchpad on the frontpage, I'll have to post a link here below:

https://plus.google.com/115547683951727699051/posts/eJ2pd...

( For the uninvited, large parts of the first paragraph was snark and sarcasm.)

Yet another opportunity for opportunistic suspend

Posted Oct 20, 2011 22:55 UTC (Thu) by mclasen@redhat.com (subscriber, #31786) [Link]

> Session managers already do something similar for screen savers (though
> that's in user's session scope, not global). Also desktop environment
> developers have introduced lots of new odd daemons recently, I'm surprised
> they haven't came up with a suspend policy framework yet.

The inhibit api of gnome-session lets you do just that:

http://people.gnome.org/~mccann/gnome-session/docs/gnome-...

Not sure what 'odd daemons' you have in mind, but as far as desktops are concerned, the policy belongs in the user session.

Yet another opportunity for opportunistic suspend

Posted Oct 21, 2011 11:48 UTC (Fri) by intgr (subscriber, #39733) [Link]

> The inhibit api of gnome-session lets you do just that
> as far as desktops are concerned, the policy belongs in the user session
Not if this policy affects all users of a computer. The computer shouldn't autosuspend if another user has important applications running that block suspend.

> Not sure what 'odd daemons' you have in mind
If you haven't peeked into your process list lately, here's a few:
colord, upowerd, udisks-daemon, rtkit-daemon, polkitd, accounts-daemon, NetworkManager, modem-manager

Yet another opportunity for opportunistic suspend

Posted Oct 21, 2011 8:02 UTC (Fri) by pabs (subscriber, #43278) [Link]

If your computer/tablet/phone can play music while suspended (probably some ARM devices can do this) then your preferences would mean extra power use.

Yet another opportunity for opportunistic suspend

Posted Oct 27, 2011 16:10 UTC (Thu) by Wol (guest, #4433) [Link]

Equally, they would avoid trashed files ...

I had a load of audacity projects on my Linpus Aspire and did an mv to move them to my desktop.

With hindsight leaving the Aspire on the desk to finish copying was a major mistake - it kept suspending, breaking network links, and I ended up having to repeatedly wake it. What's worse, it didn't move stuff properly, and having started working on those projects on the desktop, I discovered a load of files had been trashed, leaving holes in the audio. Seeing as I'd done an mv, not a cp, recovery was not possible ... :-(

Suspending at the wrong time will trash your data ...

Cheers,
Wol

Yet another opportunity for opportunistic suspend

Posted Oct 27, 2011 17:12 UTC (Thu) by intgr (subscriber, #39733) [Link]

> I had a load of audacity projects on my Linpus Aspire and did an mv to move them to my desktop.

This is a problem with opportunistic suspend. This is a bug in the protocol/file system you used to access the remote machine. A proper one would return the network error back to mv as an I/O error, and mv would abort without deleting the source file.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds