From owner-freebsd-questions Mon May 20 9:59:26 2002 Delivered-To: freebsd-questions@freebsd.org Received: from tamu-relay.tamu.edu (smtp-relay-2.tamu.edu [128.194.103.91]) by hub.freebsd.org (Postfix) with ESMTP id C811637BF77 for ; Mon, 20 May 2002 09:43:44 -0700 (PDT) Received: from localhost (wolf.tamu.edu [128.194.177.13]) by tamu-relay.tamu.edu (8.11.4/8.11.4) with ESMTP id g4KGhhF63634; Mon, 20 May 2002 11:43:43 -0500 (CDT) Date: Mon, 20 May 2002 11:43:43 -0500 Subject: Re: Intercepting ATX power switch Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v481) Cc: FreeBSD Questions To: BSD Freak From: David J Duchscher In-Reply-To: <55dad556061f.56061f55dad5@mbox.com.au> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.481) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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