Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Apr 2004 12:38:07 -0700
From:      Rishi Chopra <rchopra@cal.berkeley.edu>
To:        questions@freebsd.org
Subject:   Re: apcupsd and 'shutdown -p'
Message-ID:  <408AC21F.7030306@cal.berkeley.edu>
In-Reply-To: <40856E4C.7020300@cal.berkeley.edu>
References:  <40856E4C.7020300@cal.berkeley.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Rishi Chopra wrote:
> I'd like apcupsd to call 'shutdown -p' when halting the system. 
> Currently the daemon works OK but allows for a race condition (e.g. 
> battery is not dead but power is restored, leaving the system waiting 
> for a key to be pressed)...
> 
> Anyone have any ideas on how to accomplish this?
> 

Problem has been solved.  Command can be aliased through shell variable 
manipulation -or- as Neil Darlow suggested on the apcupsd mailing list 
([apcupsd-users] apcupsd and 'shutdown -p', 4/23/2004, 1:20AM):


Just change the shutdown command in the doshutdown case within 
apccontrol to the following:

     doshutdown)
         echo "UPS ${2} initiated Shutdown Sequence" | wall
         ${SHUTDOWN} -p now "apcupsd UPS ${2} initiated shutdown"
     ;;

Note: this will require APM or ACPI to be enabled in your BIOS and system
configuration (i.e. run apmd at startup for APM or enable ACPI in your
kernel). ACPI is still experimental, your mileage may vary.


NOTE: files referenced located in /usr/local/etc/apcupsd

-- 
Rishi Chopra
http://www.ocf.berkeley.edu/~rchopra



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