rosetta-at-home icon indicating copy to clipboard operation
rosetta-at-home copied to clipboard

Investigate ways to improve power management for old laptops

Open chrisys opened this issue 4 years ago • 3 comments

With the current implementation of power-management, there are cases where if a laptop is closed and that container stops (for reasons such as update), the device could fall into a sleep state.

To quote @rahul-thakoor "if the power-management service dies, the lock for the file descriptor is released and the action is removed!"

chrisys avatar Apr 17 '20 08:04 chrisys

This is currently achieved using dbus and systemd inhibit locks. We are using handle-lid-switch in block mode which inhibits the low-level handling of the systemd hardware lid switch.

From the documentation,

Inhibit() returns a single value, a file descriptor that encapsulates the lock. As soon as the file descriptor is closed (and all its duplicates) the lock is automatically released. If the client dies while the lock is taken the kernel automatically closes the file descriptor so that the lock is automatically released.

The current problem is the container creating the lock can die for e.g during an update and cause the lock to be released.

rahul-thakoor avatar Apr 27 '20 04:04 rahul-thakoor

This should be resolved by setting RESIN_SUPERVISOR_UPDATE_STRATEGY to hand-over

chrisys avatar May 05 '20 09:05 chrisys

Tested on device running intel-nuc image

rahul-thakoor avatar May 05 '20 10:05 rahul-thakoor