On 18/04/2021 11.19, Roger Price wrote:
On Sat, 17 Apr 2021, Carlos E. R. wrote:
On 17/04/2021 21.43, Roger Price wrote:
On Sat, 17 Apr 2021, Carlos E. R. wrote:
Methinks that depleting the battery to 10 is a very severe wear on it. I would go for 50% tops. If the system is not capable of going down fast...
If you try to power down my machine at 23:50 hours, it will not go down till 00:15, or worse, 00:30. Other times, yes, it will go down fast.
How do you hold back /sbin/shutdown for what might be 40 minutes? Is the Salicru capable of supplying power to the system for 40 minutes and still have 50% reserve? This will need testing.
I don't. If the mains power fails that instant and I'm not there, the UPS dies of exhaustion and the machine with it.
For me, this would not be acceptable.
It isn't.
At least with hibernation, which is what I do. The system tries to sync the filesystem, and if it does that during the interval 23:45 to 00:15 the kernel is not capable of syncing the filesystem while texpire is running. The cron-job texpire has to be killed first, then the machine can be told to hibernate. I have not tested this yet.
What is the advantage of hibernation for a desktop system? The machine does no useful work, yet consumes energy from the UPS. A "proper" shutdown would kill texpire and not drain the battery, which you have said you want to avoid.
Hibernation (if it works properly) saves battery and preserves the status and my work (sleep mode needs power for the ram; hibernation doesn't). I may be doing something important which will be lost with a power down. Maybe I left the office for a moment to buy some milk for the coffee, without saving, and the power fails just then. Or maybe I'm running a long process which does not save intermediate steps, it would be lost. I may be doing things in the terminals and taking notes, and I have not yet took and saved the notes for something. Myriad cases. But otherwise, I simply use hibernation every day because it preserves the status of the desktop, and restoring saves me a few minutes of starting again all the things and load all the files (no, desktop save doesn't go that far). Normally I have open several workspaces, and have different things started on each (mail, web, libreoffice, photos, a virtual machine...). If I tire of something I switch to another one with a different task and continue later or tomorrow, knowing that tomorrow everything will be there because I do not poweroff but hibernate. Yes, I could leave the machine running all the time, but that wears the hard disks and uses electricity which has to be paid.
I do not use hibernation. I find I am better served with a shutdown --poweroff and an automatic restart when utility power returns.
I have not tested power down during that interval yet (I thought I had).
I did yesterday, it works.
There are other issues:
- sometimes hibernation fails, and has to be called a second time. How to automate this?
I'm guessing that you specify something like SHUTDOWNCMD "systemctl start systemd-hibernate.service" in upsmon.conf. You would have to replace this with a call of a script which watches over systemctl status systemd-hibernate.service and restarts the service if it fails. This is becoming complicated.
It is complicated, because that service returns instantly, while the hibernation sequence runs independently. I don't know of a way to find out (by script) if it worked or failed. Consider that if it worked, my script may continue running after restoring two hours later. Not easy.
It might also be advisable to not execute the command upsdrvctl shutdown in order to avoid turning off the UPS power outlets.
The proper thing would be to power down the UPS automatically either a minute after issuing the command, or when it senses the computer is down. But this is a job for the hardware. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)