-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[client] Add support of UPower to detect battery status on linux #3425
base: master
Are you sure you want to change the base?
Conversation
Thanks so much Vitalii for getting this new on-battery detect structure put into the module. |
@BOINC/committer, could anyone review this PR, please? |
I was taking a look at this and I ran
As a result, BOINC never stopped running. However with the previous version of the code the client stopped immediately. I'm running
I'm not sure why upower isn't updating the on-battery state since it recognized that the batteries were discharging. |
There is an open issue for this: https://gitlab.freedesktop.org/upower/upower/issues/22 |
Signed-off-by: Vitalii Koshura <[email protected]>
8b0de9a
to
fc7432a
Compare
Sounds like no one has tested the upower detect on a UPS battery backed system. Which was the whole impetus for asking for the new detect method. Exactly what do I need to do to test this for you. I assume I need to pull in the new revised module and compile the client. How do I get the new module? |
@KeithMyers, if you feel confident working with command line:
Then just build it |
I was trying to read the code and I wonder if a better choice for the detected status would be "discharging" instead of "on-battery".
Or does the code read the daemon output of on-battery state? yes||no?
Trying to understand what the upower docs mean. So what does 'b' represent? The "OnBattery" property |
@KeithMyers, I'm not sure that detecting 'discharging' string is a good idea. 'on-battery' should be either 'yes' or 'no', and we actually read this boolean state. If daemon for some reason doesn't change correctly this status, shame on it. But if we add 'discharging' as a criteria of search, then we will have next matrix:
And even if case 2 I can accept as 'Yes', so what about case 3? I definitely can't reproduce this |
Don't know. I don't understand programming syntax. I can read it is about all I can do. Comprehension is beyond my skills presently. I have your branch. Now just have to compile it into a new client for testing. Will get to it tomorrow. Then I can pull the plug on my UPS while watching upower state and see if the Manager drops the compute load. |
I think need to add dependency in https://github.com/BOINC/boinc/blob/master/client/scripts/boinc-client.service.in just to be sure https://fedoramagazine.org/systemd-unit-dependencies-and-order/ |
@truboxl, which dependency? |
@AenBleidd Sorry for the long delay, I am thinking upower.service |
A couple of suggestions:
|
@davidpanderson, thanks for the review. I'll make necessary changes asap |
Signed-off-by: Vitalii Koshura [email protected]