[3828] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: UPS reccomendations

daemon@ATHENA.MIT.EDU (Eric Smith)
Mon Nov 11 02:41:24 1996

Date: 11 Nov 1996 08:29:23 -0000
From: Eric Smith <eric@brouhaha.com>
To: redhat-list@redhat.com
CC: Richard Bullington <rbulling@obscure.org>
In-reply-to: <Pine.LNX.3.94.961111015827.7250G-100000@marduk.obscure.org>
	(message from Richard Bullington on Mon, 11 Nov 1996 02:09:27 -0500
	(EST))
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Richard Bullington <rbulling@obscure.org> wrote:
> In apcd-0.5, the source code for do_shutdown is crystal clear. It signals
> the UPS to shut down, then initiates a regular shutdown via calling
> "/sbin/shutdown now -hft 2" , which will halt the system after only a few
> seconds in most cases.
> 
> (from apcd.h:)
> #define _PATH_SHUTDOWN   "/sbin/shutdown"
> #define SHUTDOWN_ARGS "shutdown","now","-hft","2"

You must have a newer version than I was able to find on SunSite; mine
claims to be version BETA 0.5, and the equivalent lines in apcd.h are:

#define _PATH_UMOUNT    "/bin/umount"
#define UMOUNT_ARGS     "umount","-a"
#define _PATH_MTAB      "/etc/mtab"

The do_shutdown() function is much more complex in the version I've got,
and does (as the includes imply) try to do everything by itself.

Even calling /sbin/shutdown doesn't seem to me like it is the right thing.
The init program deliberately was designed to understand the SIGPWR to
handle power failures and restorations.  That way if the power is restored
after the computer is notified of a power failure but before the chosen
on-battery run time has elapsed, the daemon can signal init again to abort
the shutdown.

Cheers,
Eric


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post