powerd-dbus network extension
Paul Fox
pgf at laptop.org
Tue Sep 6 11:36:47 EDT 2011
daniel wrote:
> On Wed, Aug 3, 2011 at 7:07 PM, Daniel Drake <dsd at laptop.org> wrote:
> > Hi Paul,
> >
> > For 11.3.0 I'd like to implement a solution for the issue where powerd
> > idle-suspends while wifi connections are being established, causing
> > connection failures and other undesirable activity.
> >
> > The solution I'm thinking of isn't ideal in that it adds a mini-daemon
> > alongside powerd.
>
> Now implemented, tested and ready for review:
> http://dev.laptop.org/git/users/dsd/powerd
hi daniel -- thanks for all the work on this.
initial thoughts:
- is there anything special about the network inhibit? i wonder if
we should future-proof this by making it a generic
"inhibit-suspend"/"allow-suspend" message? it might have other
uses. but in that case, the requests have to nest correctly. so
maybe something like:
inhibit-suspend)
: $(( no_suspend++ ))
;;
allow-suspend)
: $(( no_suspend = (no_suspend > 0) ? no_suspend - 1 : 0 ))
;;
there may be value, though, in knowing who sent the message, if
only for debugging -- that information can be passed as a second
argument on the event. (the first argument should be a timestamp.)
- does powerd-dbus always die correctly and cleanly when powerd dies?
paul
p.s. i think i eliminated the only instance of this kind of thing by
changing the inhibitor to a counter, above, but for the future: i
prefer shell booleans to either have (some) value or not:
so, for example:
network_suspend_ok=true
and:
network_suspend_ok=;
then the test is:
if [ "$network_suspend" ]
...
>
> I didn't go with the rfkill extra in the end - wasn't quite as simple
> as I'd hoped. Needs a fresh look, which may even result in it being
> fixed elsewhere.
>
> Thanks,
> Daniel
=---------------------
paul fox, pgf at laptop.org
More information about the Devel
mailing list