UPS means Uninterruptible Power Supply. The UPS is a device which has a rechargeable battery provides electrical power for a few minutes after the outage, depending on its specifications. However, UPS is not a power generator and its mission is NOT to continue the operation of the computer for all the duration of the blackout. A UPS:
- protects the computer from (usually instantaneous, but often dangerous) surge of electricity
- gracefully shuts down computer some minutes after power outage
- can force computer restart when the power returns (if AC back function supported by computer BIOS)
The first (1) is achieved just connecting computer with the UPS. But (2) and (3) require specific software, which provides additional control of the UPS.
Manufacturers provide relevant software mainly for Windows.
On Linux there are excellent open source solutions. Examples include:
- apcupsd (supports APC UPS)
- Network UPS tools (NUT) supports a variety of devices
Power Management module on Ubuntu 16.04 is a flexible tool to manage your computer UPS. If you have a UPS dedicated to your workstation, Ubuntu “Power Management” is all you need.
Ubuntu Power Settings
Ubuntu will recognize your UPS in most cases.
You can access “Power Management” or “Power Settings” using Ubuntu Unity Dash (see image) or from the applications menu in other Ubuntu flavors. Open Dash (press SUPER key) and type something like “power”
But “Power Management” or “Power Settings” is also available from the desktop top bar.
Just click on “Power Settings”. Here you can choose from the available options. The most important is “Where power is critically low” action. Here, select “Power off”. This means that when UPS power is critically low after a power outage, Ubuntu will gracefully shutdown your computer. This is very important to avoid hardware damage (mainly hard disk damage) and data loss.
Advanced Power Settings
You may want to define when power is critically low or to set another action in this case, except of “Power Off” and “Hibernate” which are available in “Power Settings” dialog. In this case you have to setup dconf editor. So, open terminal and give:
sudo apt-get install dconf-tools
Now, you can access “dconf editor” using Ubuntu Unity Dash or from the applications menu in other Ubuntu flavors. Open Dash (press SUPER key) and type something like “dconf”.
In the tree structure of dconf editor use the following path
org → gnome → settings-daemon → plugins → power
So, you may change critical-battery-action parameter (see image)
You may also change percentage-critical parameter. For example, you may set it from default 3% to 10% which is more safe (see image).
Entrepreneur | Full-stack developer | Founder of MediSign Ltd. I have over 15 years of professional experience designing and developing web applications. I am also very experienced in managing (web) projects.