Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 May 2002 11:43:43 -0500
From:      David J Duchscher <daved@nostrum.com>
To:        BSD Freak <bsd-freak@mbox.com.au>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Intercepting ATX power switch
Message-ID:  <BF12A6CF-6C10-11D6-96E8-00306547FB28@nostrum.com>
In-Reply-To: <55dad556061f.56061f55dad5@mbox.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
This is what I did.  There may be a better way but this does work for me.

You need to set up your BIOS to do a suspend instead of powering off the 
machine whent he power button is hit.  Next, you need to update the 
/etc/apmd.conf file to issue the shutdown command.  Then you need to start 
up apmd (APMD_ENABLE in rc.conf).  This is the apmd.conf file that I use:

apm_event USERSUSPENDREQ {
         exec "logger -t apmd user suspend at `date +'%Y%m%d %H:%M:%S'`";
         exec "shutdown -p now";
}

apm_event SUSPENDREQ {
         exec "logger -t apmd suspend at `date +'%Y%m%d %H:%M:%S'`";
         exec "shutdown -p now";
}

Only one of these will get called.  I use this file on multiple machines 
and some fire the USERSUSPENDREQ, others fire the SUSPENDREQ.

DaveD


On Sunday, May 19, 2002, at 04:23 PM, BSD Freak wrote:

> Hi everyone,
>
> I have compiled my 4.5 kernel with the "device apm" option and enabled
> APM in rc.conf. The "shutdown -p now" command works well and powers off
> the machine as it is supposed to. Now what I *REALLY* need is to
> intercept the ATX power switch so that the machine does a proper
> shutdown when the ATX power switch is hit (the way Win2K does). Can
> anyone help me with this one ..... please. :-)
>
> Thanks in advance.....
>
> ---------------------------------------------------------------------
> NEW to mBox, receive faxes to any email address!
> Find out more http://www.mbox.com.au/fax
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BF12A6CF-6C10-11D6-96E8-00306547FB28>