[Nut-upsuser] Proxmox as secondary gets power interrupted during VM shutdown

Roger Price roger at rogerprice.org
Fri Aug 26 10:29:28 BST 2022


On Fri, 26 Aug 2022, Jim Klimov via Nut-upsuser wrote:

> I'd expect upsmon service to only begin stopping when something like 
> multi-user target has finished stopping, but not sure quickly if packaging 
> covers that, and/or if VMs are part of that target. Maybe a "drop-in" file for 
> e.g. nut-client would help you define custom end-of-life dependencies. Systemd 
> has tons of keywords and nuance interactions to choose from.

I was disappointed when I saw that the systemd service units did not allow for 
adequate logging, so I use a custom version

  # nut-delayed-ups-shutdown.service
  [Unit]
    Description=Initiate delayed UPS shutdown
    Before=umount.target
    DefaultDependencies=no
  [Service]
    Type=oneshot
    ExecStart=/usr/bin/logger -t nut-delayed-ups-shutdown "upsdrvctl shutting down UPS"
    ExecStart=/usr/sbin/upsdrvctl shutdown        # Debian
  [Install]
    WantedBy=final.target

Note the line Before... to ensure that the logging goes to disk, and the first 
ExecStart... to get a trace of the action.

Maybe there are other options which do this more elegantly.

Roger



More information about the Nut-upsuser mailing list