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

_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to