1 diff -urN apcupsd-3.8.1/Makefile.in apcupsd-3.8.1.grzegorz/Makefile.in
2 --- apcupsd-3.8.1/Makefile.in Mon Dec 4 08:04:56 2000
3 +++ apcupsd-3.8.1.grzegorz/Makefile.in Sun Jun 10 15:59:29 2001
5 # this is a list of all subdirectories that contain or could contain Makefiles
7 subdirs = . @INTLSUB@ @POSUB@ cgi doc lib contrib distributions distributions/debian \
8 - distributions/freebsd distributions/hpux distributions/openbsd distributions/redhat \
9 + distributions/freebsd distributions/hpux distributions/openbsd distributions/pld distributions/redhat \
10 distributions/slackware distributions/sun distributions/suse \
11 distributions/unifix win32
15 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
16 $(srcdir)/distributions/redhat/* $(srcdir)/distributions/debian/* \
17 + $(srcdir)/distributions/pld/* \
18 $(srcdir)/distributions/slackware/* $(srcdir)/distributions/suse/* \
19 $(srcdir)/distributions/unifix/* $(srcdir)/distributions/unknown/* \
20 $(srcdir)/intl/* $(srcdir)/po/* $(srcdir)/etc/*
21 diff -urN apcupsd-3.8.1/configure apcupsd-3.8.1.grzegorz/configure
22 --- apcupsd-3.8.1/configure Mon Dec 11 22:52:51 2000
23 +++ apcupsd-3.8.1.grzegorz/configure Sun Jun 10 16:02:23 2001
25 distributions/redhat/apccontrol.sh \
26 distributions/redhat/awkhaltprog \
27 distributions/redhat/apcupsd.spec \
28 + distributions/pld/Makefile \
29 + distributions/pld/apcupsd \
30 + distributions/pld/apccontrol.sh \
31 distributions/unknown/Makefile \
32 distributions/unknown/apcupsd \
33 distributions/unknown/apccontrol.sh \
34 diff -urN apcupsd-3.8.1/distributions/Makefile.in apcupsd-3.8.1.grzegorz/distributions/Makefile.in
35 --- apcupsd-3.8.1/distributions/Makefile.in Fri Sep 22 17:02:21 2000
36 +++ apcupsd-3.8.1.grzegorz/distributions/Makefile.in Sun Jun 10 15:59:29 2001
38 # Generic install program.
41 -SUBDIRS = freebsd redhat sun unknown hpux suse openbsd \
42 +SUBDIRS = freebsd redhat sun unknown hpux suse openbsd pld \
45 # Some makes apparently use .PHONY as the default goal if it is before `all'.
46 diff -urN apcupsd-3.8.1/distributions/pld/Makefile.in apcupsd-3.8.1.grzegorz/distributions/pld/Makefile.in
47 --- apcupsd-3.8.1/distributions/pld/Makefile.in Thu Jan 1 01:00:00 1970
48 +++ apcupsd-3.8.1.grzegorz/distributions/pld/Makefile.in Sun Jun 10 15:59:29 2001
51 +# This file is used as the template to create the
52 +# Makefile for the RedHat 5.2, 6.0 and 6.1 specific
60 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
65 + @if test -f /etc/rc.d/init.d/apcupsd; then \
66 + /sbin/chkconfig --del apcupsd; \
68 + # remove old 3.6.2 stuff
69 + @rm -f /etc/rc.d/rc0.d/K20apcups
70 + @rm -f /etc/rc.d/rc1.d/S20apcups
71 + @rm -f /etc/rc.d/rc1.d/K20apcups
72 + @rm -f /etc/rc.d/rc2.d/S20apcups
73 + @rm -f /etc/rc.d/rc3.d/S20apcups
74 + @rm -f /etc/rc.d/rc5.d/S20apcups
75 + @rm -f /etc/rc.d/rc6.d/K20apcups
76 + @rm -f /etc/rc.d/init.d/apcups
77 + @$(INSTALL_PROGRAM) -m 744 apcupsd /etc/rc.d/init.d/apcupsd
78 + # save old halt script
79 + @cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.old
80 + # insert apcupsd script into halt
81 + @awk -f awkhaltprog /etc/rc.d/init.d/halt.old >/etc/rc.d/init.d/halt
82 + @chmod 744 /etc/rc.d/init.d/halt
83 + # link new halt script for startup and shutdown
84 + @/sbin/chkconfig --add apcupsd
85 + @echo "================================================="
87 + @echo "apcupsd script installation for RedHat $(DISTVER) complete."
89 + @echo "You should now edit /etc/apcupsd/apcupsd.conf to correspond"
90 + @echo "to your setup then start the apcupsd daemon with:"
92 + @echo "/etc/rc.d/init.d/apcupsd start"
94 + @echo "thereafter when you reboot, it will be stopped and started"
95 + @echo "automatically."
97 + @echo "Please check that your halt script in:"
98 + @echo " /etc/rc.d/init.d/halt"
99 + @echo "was properly updated (see installation section of manual)"
101 + @echo "================================================="
104 + @echo "Removing symlinks..."
105 + @/sbin/chkconfig --del apcupsd
106 + @echo "Removing boot script..."
107 + @rm -f /etc/rc.d/init.d/apcupsd
108 + @echo "Restoring old halt script"
109 + @cp -f /etc/rc.d/init.d/halt.old /etc/rc.d/init.d/halt
114 + @rm -f apccontrol.sh apcupsd awkhaltprog Makefile
115 diff -urN apcupsd-3.8.1/distributions/pld/apccontrol.sh.in apcupsd-3.8.1.grzegorz/distributions/pld/apccontrol.sh.in
116 --- apcupsd-3.8.1/distributions/pld/apccontrol.sh.in Thu Jan 1 01:00:00 1970
117 +++ apcupsd-3.8.1.grzegorz/distributions/pld/apccontrol.sh.in Sun Jun 10 15:59:29 2001
121 +# Copyright (C) 1999-2000 Riccardo Facchetti <riccardo@master.oasi.gpa.it>
127 +# These variables are needed for set up the autoconf other variables.
130 +exec_prefix=@exec_prefix@
132 +APCPID=@PIDDIR@/apcupsd.pid
133 +APCUPSD=@sbindir@/apcupsd
134 +SHUTDOWN=/sbin/shutdown
135 +SCRIPTSHELL=@SCRIPTSHELL@
136 +SCRIPTDIR=@sysconfdir@
139 +# This piece is to substitute the default behaviour with your own script,
140 +# perl, or C program.
141 +# You can customize every single command creating an executable file (may be a
142 +# script or a compiled program) and calling it the same as the $1 parameter
143 +# passed by apcupsd to this script.
145 +# After executing your script, apccontrol continues with the default action.
146 +# If you do not want apccontrol to continue, exit your script with exit
147 +# code 99. E.g. "exit 99".
149 +# WARNING: the apccontrol file will be overwritten every time you update your
150 +# apcupsd, doing `make install'. Your own customized scripts will _not_ be
151 +# overwritten. If you wish to make changes to this file (discouraged), you
152 +# should change apccontrol.sh.in and then rerun the configure process.
154 +if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ]
156 + ${SCRIPTSHELL} ${SCRIPTDIR}/${1}
157 + # exit code 99 means he does not want us to do default action
158 + if [ $? = 99 ] ; then
165 + echo "Apccontrol doing: ${APCUPSD} --killpower"
166 + ${APCUPSD} --killpower
169 + wall "Warning serial port communications with UPS lost."
172 + wall "Serial communciations with UPS restored."
175 + wall "Warning power loss detected."
178 + wall "Power failure. Running on UPS batteries."
181 + wall "UPS battery power exhaused. Doing shutdown."
184 + wall "UPS battery runtime limit exceded. Doing shutdown."
187 + wall "UPS battery discharge limit reached. Doing shutdown."
190 + wall "UPS battery runtime percent reached. Doing shutdown."
193 + wall "Beginning Reboot Sequence"
194 + ${SHUTDOWN} -r now "apcupsd initiated reboot"
197 + wall "Beginning Shutdown Sequence"
198 + ${SHUTDOWN} -h now "apcupsd initiated shutdown"
201 + wall "Power has returned..."
202 + if [ -f @sysconfdir@/powerfail ] ; then
203 + wall "Attempting to cancel shutdown."
208 + wall "Power problems please logoff."
211 + wall "Emergency Shutdown. Possible UPS battery failure."
212 + ${SHUTDOWN} -h now "apcupsd emergency shutdown"
215 + wall "Emergency! UPS batteries have failed. Change them NOW"
218 + wall "Remote Shutdown. Beginning Shutdown Sequence."
219 + ${SHUTDOWN} -h now "apcupsd remote shutdown"
222 + echo -n "Restarting APCUPSD Power Management: "
223 + THEPID=`cat ${APCPID}`
226 + rm -f @sysconfdir@/powerfail
232 + *) echo "Usage: ${0##*/} command"
233 + echo " warning: this script is intended to be launched by"
234 + echo " apcupsd and should never be launched by users."
238 diff -urN apcupsd-3.8.1/distributions/pld/apcupsd.in apcupsd-3.8.1.grzegorz/distributions/pld/apcupsd.in
239 --- apcupsd-3.8.1/distributions/pld/apcupsd.in Thu Jan 1 01:00:00 1970
240 +++ apcupsd-3.8.1.grzegorz/distributions/pld/apcupsd.in Sun Jun 10 15:59:29 2001
244 +# apcupsd This shell script takes care of starting and stopping
245 +# the apcupsd UPS monitoring daemon.
247 +# chkconfig: 2345 20 99
248 +# description: apcupsd monitors power and takes action if necessary
250 +APCPID=@PIDDIR@/apcupsd.pid
252 +# Source function libarary
253 +. /etc/rc.d/init.d/functions
257 + if [ ! -f /var/lock/subsys/apcupsd ]; then
258 + msg_starting apcupsd
259 + daemon @sbindir@/apcupsd -f @sysconfdir@/apcupsd.conf
261 + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apcupsd
263 + msg_Already_Running apcupsd
268 + if [ -f /var/lock/subsys/apcupsd ]; then
269 + msg_stopping apcupsd
271 + rm -f /var/lock/subsys/apcupsd $APCPID
273 + msg_Not_Running apcupsd
282 + @sbindir@/apcaccess status
285 + echo "Usage: $0 {start|stop|restart|status}"
290 diff -urN apcupsd-3.8.1/distributions/pld/awkhaltprog.in apcupsd-3.8.1.grzegorz/distributions/pld/awkhaltprog.in
291 --- apcupsd-3.8.1/distributions/pld/awkhaltprog.in Thu Jan 1 01:00:00 1970
292 +++ apcupsd-3.8.1.grzegorz/distributions/pld/awkhaltprog.in Sun Jun 10 15:59:29 2001
295 +# Awk program to insert the necessary apcupsd script in
298 +# Suff left over from a previous apcupsd, remove it
299 +/^# See if this is a powerfail situation\./ {
302 + } while (length($0) != 0)
305 +# We insert our code just before this line
306 +/^# Now halt or reboot\./ {
307 + print "# See if this is a powerfail situation. # ***apcupsd***"
308 + print "if [ -f @sysconfdir@/powerfail ]; then # ***apcupsd***"
309 + print " echo # ***apcupsd***"
310 + print " echo \"APCUPSD will now power off the UPS\" # ***apcupsd***"
311 + print " echo # ***apcupsd***"
312 + print " @sysconfdir@/apccontrol killpower # ***apcupsd***"
313 + print " echo # ***apcupsd***"
314 + print " echo \"Please ensure that the UPS has powered off before rebooting\" # ***apcupsd***"
315 + print " echo \"Otherwise, the UPS may cut the power during the reboot!!!\" # ***apcupsd***"
316 + print " echo # ***apcupsd***"
317 + print " sleep 2d # ***apcupsd***"
318 + print " exit 0 # ***apcupsd***"
319 + print "fi # ***apcupsd***"
322 +# everything else is duplicated