UPS shutdown with `sysutils/nut': where should I place "power off" command to UPS?

Erik Trulsson ertr1013 at student.uu.se
Sun Jun 15 16:37:59 UTC 2008


On Sun, Jun 15, 2008 at 07:08:10PM +0400, Lev Serebryakov wrote:
> Hello, freebsd-hackers.
> 
>   nut's documentation says[1], that UPS should be switched off from
> shutdown scripts in point, when FSes are synced and re-mounted as R/O.

Problem is, on FreeBSD the FSes are not re-mounted as R/O during shutdown.

> 
>   google shows thread[2], according to which, last line of
> `/etc/rc.shutdown' is too early, and if power will be switched off at
> this line, FSes will be dirty on boot.

Correct.

> 
>   What is proper place for "power off" command on FreeBSD system?

There isn't any.  On FreeBSD the filesystems are synced and marked as clean
by the kernel, *after* all the shutdown scripts have finished.
(Unlike Linux where the shutdown scripts are responsible for syncing and
umounting/re-mounting the file systems.)

> 
>   Please, note, that it is NOT `shutdown -p', but signal to UPS to
> switch off EXTERNAL power when battarey is almost dead, and no
> external power, and `shutdown -p' turns off only computer, not UPS.

You need an UPS that can accept a signal that says 'shut down in 20 seconds
time' (the value 20 may have to be adjusted) and send that as the last thing
in the shutdown scripts, which should cause the UPS to shutdown shortly
after 'shutdown -p' has turned off the computer.

> 
> 
> [1] http://www.networkupstools.org/doc/2.2.0/shutdown.html
> [2] http://lists.freebsd.org/pipermail/freebsd-questions/2006-May/122764.htm
> 



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se


More information about the freebsd-hackers mailing list