You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For laptops, it'd be useful if bees could automagically suspend itself when it detects that the laptop is running on battery power, returning to processing once AC power is back.
The text was updated successfully, but these errors were encountered:
cat <<RULES >> /etc/udev/rules.d/60-onbattery.rules
# Stop when AC power offline
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="killall -STOP bees"
# Resume when AC power online
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="killall -CONT bees"
RULES
The above should stop bees from doing any processing while on battery, but keep the process resident in memory so it can resume immediately when AC power is restored.
It will also stop or start any random program that happens to be named bees. There's probably a better way to do that, e.g. freezer cgroup controls.
Variations:
You can use USR1 instead of STOP, and USR2 instead of CONT, if you want bees to save its state files and release open files while on battery. While on battery, there will be a low rate of continuous IO while the hash table trickles out to disk. That will eventually stop, but it might take hours. It will take longer to transition to the suspended state than the STOP/CONT method.
You can completely stop and start the service with systemctl, which will cause a large burst of IO when transitioning as the entire hash table will be saved and reloaded. It may repeat some work if you frequently transition to/from AC power.
For laptops, it'd be useful if bees could automagically suspend itself when it detects that the laptop is running on battery power, returning to processing once AC power is back.
The text was updated successfully, but these errors were encountered: