Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2008 18:22:47 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org, mtm@freebsd.org
Subject:   Re: UPS shutdown with `sysutils/nut': where should I place "power off" command to UPS?
Message-ID:  <20080615162247.GA50613@owl.midgard.homeip.net>
In-Reply-To: <1283529703.20080615190810@serebryakov.spb.ru>
References:  <1283529703.20080615190810@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080615162247.GA50613>