From owner-freebsd-hackers Tue Dec 15 21:33:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA25143 for freebsd-hackers-outgoing; Tue, 15 Dec 1998 21:33:35 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id VAA25138 for ; Tue, 15 Dec 1998 21:33:33 -0800 (PST) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0zq9aK-0005C4-00; Tue, 15 Dec 1998 22:33:20 -0700 Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.1/8.8.3) with ESMTP id WAA09345; Tue, 15 Dec 1998 22:31:44 -0700 (MST) Message-Id: <199812160531.WAA09345@harmony.village.org> To: wcp@lpds.sublink.org Subject: Re: Auto power off for poor people Cc: hackers@FreeBSD.ORG In-reply-to: Your message of "Tue, 15 Dec 1998 19:17:18 +0100." <13942.39950.631562.882793@luppolo.lpds.sublink.org> References: <13942.39950.631562.882793@luppolo.lpds.sublink.org> Date: Tue, 15 Dec 1998 22:31:43 -0700 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <13942.39950.631562.882793@luppolo.lpds.sublink.org> "Walter C. Pelissero" writes: : Since I think it might be of general interest (I saw a few requests in : freebsd-questions), here are the patches I made to a 2.2.7 system to : get the power-off-on-shutdown feature. I think that Mike Smith has already implemented this. : While at this. It would be nice to have a shutdown on power-off : switch in FreeBSD 3.0. Judging from the switch block in : apm_processevent() function it seems there is not even an hook for a : daemon doing this kind of job. PMEV_POWERSTATECHANGE is ignored. Am : I wrong? FreeBSD power management is in the kernel. There are no provisions for having a daemon control this. I'd like there to be either a loadable module that copes, or a userland daemon with an expansion of the apm interface. I have a kludge shell script somewhere that is a proof of concept for a battery daemon for my Libretto so I could suspend it when idle and the machine is plugged in and the battery charge isn't 100%. It would sleep for 2x 100 - the percentage of battery minutes and then wake up again. My Libretto 50 doesn't charge while on.... However, the script is a total kludge and I'd rather have some simple tcl driven (or perl drive, I don't care which scripting language) powerd that would allow me to do things like this. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message