From owner-freebsd-hackers Wed Feb 5 09:23:09 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA10186 for hackers-outgoing; Wed, 5 Feb 1997 09:23:09 -0800 (PST) Received: from Guard.Polynet.Lviv.UA ([194.44.138.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA09106 for ; Wed, 5 Feb 1997 09:22:33 -0800 (PST) Received: (from smap@localhost) by Guard.Polynet.Lviv.UA (8.8.4/8.6.12) id TAA14360; Wed, 5 Feb 1997 19:19:55 +0200 (EET) Received: from netsurfer.lp.lviv.ua(192.168.0.3) by Guard.Polynet.Lviv.UA via smap (V2.0beta) id xma014357; Wed, 5 Feb 97 19:19:49 +0200 Received: (from smap@localhost) by NetSurfer.lp.lviv.ua (8.8.5/8.6.12) id TAA18357; Wed, 5 Feb 1997 19:19:44 +0200 (EET) Message-Id: <199702051719.TAA18357@NetSurfer.lp.lviv.ua> Received: from ws37.lp.lviv.ua(192.168.0.37) by NetSurfer.lp.lviv.ua via smap (V2.0beta) id xma018353; Wed, 5 Feb 97 19:19:25 +0200 Comments: Authenticated sender is From: "Slavik Terletsky" Organization: State University "Lvivska Polytechnika" To: stevel@logues.rhn.orst.edu Date: Wed, 5 Feb 1997 19:21:54 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: UPS daemon Reply-to: ts@polynet.lviv.ua CC: FreeBSD-hackers@FreeBSD.org Priority: normal X-mailer: Pegasus Mail for Windows (v2.42a) Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hello I managed to hack upsd. As most of ppl who has APC Smart UPS I use it in a dumb mode (I had no info on the cabling UPS to my box). You may change it the way you want to get your UPS work, it is written in C. Wanna deep your knowledge in ups daemons ? Then drop a note to Harvey J. Stein , he made a "UPS HOWTO". (I don't remember the http URL for this). So, here it is: UPS daemon for FreeBSD (2.1.5 - tested). Interacts with APC Smart-UPS 1400 in a dumb mode. Connection scheme: UPS (pin, signal name) PC (pin, signal name) ---------------------- --------------------- 1 Shutdown >-----------> 4 Data Terminal Ready 2 Line Failed >-----------> 8 Clear To Send 4 Common >-----------> 5 Ground 5 Battery Low >--------+--> 1 Data Carrier Detector 8 Battery (+24V) >--|10K|-+ UPSD DESCRIPTION usage: upsd [wait [script]] device - device name upsd interacts thru (e.g. /dev/cuaa1) wait - time (secs) to wait before running script, (default value 0 sec). script - system shutdown script (default /etc/rc.shutdown). Actions: upsd logs all the changes of UPS status (power {up,down}, battery {low,ok}). When "power down" and "battery low" upsd activates UPS SHUTDOWN signal, waits for a seconds, and then runs system shutdown script -