Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Investigate ways to improve power management for old laptops #16

Open
chrisys opened this issue Apr 17, 2020 · 3 comments
Open

Investigate ways to improve power management for old laptops #16

chrisys opened this issue Apr 17, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@chrisys
Copy link
Member

chrisys commented Apr 17, 2020

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 chrisys added the enhancement New feature or request label Apr 26, 2020
@rahul-thakoor
Copy link
Contributor

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.

@chrisys
Copy link
Member Author

chrisys commented May 5, 2020

This should be resolved by setting RESIN_SUPERVISOR_UPDATE_STRATEGY to hand-over

@rahul-thakoor
Copy link
Contributor

Tested on device running intel-nuc image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants