[Nut-upsuser] NUT on openSUSE 12.3 requires additional systemd service unit
Michal Hlavinka
mhlavink at redhat.com
Wed Aug 14 14:05:06 UTC 2013
On 08/10/2013 11:43 PM, Roger Price wrote:
> OpenSUSE 12.3 has fully embraced systemd, but to get NUT working
> correctly now requires some further systemd engineering in addition to
> the usual NUT configuration files. A new systemd service unit is needed
> to power off the UPS.
>
> The service unit consists of a new file
> /etc/systemd/system/ups-delayed-shutdown.service
>
> [Unit]
> Description=Initiate delayed UPS shutdown
> Before=umount.target
> DefaultDependencies=no
>
> [Service]
> Type=oneshot
> ExecStart=/usr/lib/ups/driver/upsdrvctl shutdown
>
> [Install]
> WantedBy=poweroff.target
>
> This service unit should be enabled with root command
>
> systemctl --system reenable
> /etc/systemd/system/ups-delayed-shutdown.service
>
> I have tested this setup with 64 bit openSUSE 12.3 and NUT 2.6.5 using
> an Eaton Ellipse ASR 1500 USBS. 9 seconds after server poweroff, the
> UPS powers off. When wall power returns the server restarts correctly.
What exactly is this supposed to do?
When system is shutting down because of power failure (and low battery)
ups should be powered off with
/lib/systemd/system-shutdown/nutshutdown
script. That's also the correct location for ups shutdown script. It's
executed after everything else.
Using Before=umount.target is especially bad bad idea. It's not
guaranteed that umount sync can finish in time, so you can have power
down during filesystem sync with all the consequences.
Michal
More information about the Nut-upsuser
mailing list