Hello community,
here is the log from the commit of package apcupsd for openSUSE:Factory
checked in at Mon Aug 29 11:01:02 CEST 2011.
--------
--- apcupsd/apcupsd.changes 2011-08-02 18:02:00.000000000 +0200
+++ /mounts/work_src_done/STABLE/apcupsd/apcupsd.changes 2011-08-26 13:54:40.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Aug 25 20:02:35 CEST 2011 - sbrabec@suse.cz
+
+- Implemented hibernate on power fail (bnc#703592#c39).
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
apcupsd-hibernate.patch
apcupsd.hibernate
apcupsd.sysconfig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ apcupsd.spec ++++++
--- /var/tmp/diff_new_pack.0Jwxab/_old 2011-08-29 10:55:12.000000000 +0200
+++ /var/tmp/diff_new_pack.0Jwxab/_new 2011-08-29 10:55:12.000000000 +0200
@@ -19,21 +19,25 @@
Name: apcupsd
-BuildRequires: apache2-devel distribution-release dos2unix gcc-c++ gconf2-devel gd-devel gnome-vfs2-devel gtk2-devel mailx ncurses-devel net-snmp-devel sysvinit tcpd-devel update-desktop-files
+BuildRequires: apache2-devel distribution-release dos2unix gcc-c++ gconf2-devel gd-devel gnome-vfs2-devel gtk2-devel mailx ncurses-devel net-snmp-devel pm-utils sysvinit tcpd-devel update-desktop-files
Group: Hardware/UPS
License: GPLv2+
Summary: APC UPS Daemon (Powerful Daemon for APC UPSs)
Version: 3.14.8
-Release: 3
+Release: 5
Url: http://www.apcupsd.com/
Source: apcupsd-%{version}.tar.bz2
Source1: apcupsd.init
Source2: README.SUSE
Source3: apcupsd-early-powerdown.init
+Source4: apcupsd.hibernate
+Source5: apcupsd.sysconfig
# PATCH-FIX-OPENSUSE apcupsd-suse.patch sbrabec@suse.cz -- Do not perform halt script alternation on install.
Patch: apcupsd-suse.patch
# PATCH-FIX-OPENSUSE apcupsd-gpp.patch sbrabec@suse.cz -- Build against C++ unfriendly system tcpd.h. See below.
Patch1: apcupsd-gpp.patch
+# PATCH-FEATURE-OPENSUSE apcupsd-hibernate.patch sbrabec@suse.cz -- Support for hibernation on powerfail.
+Patch2: apcupsd-hibernate.patch
# PATCH-FEATURE-OPENSUSE apcupsd-powersave.patch sbrabec@suse.cz -- Call powersave-notify in distros where it is available.
Patch3: apcupsd-powersave.patch
# PATCH-FIX-OPENSUSE apcupsd-largebuf-overflow.patch sbrabec@suse.cz -- Fix static buffer overflow.
@@ -73,13 +77,14 @@
%prep
%setup -q
cp -a %{S:1} platforms/suse/apcupsd.in
-cp -a %{S:2} .
+cp -a %{S:2} %{S:4} %{S:5} .
cp -a %{S:3} apcupsd-early-powerdown
chmod +x apcupsd-early-powerdown
%patch
# To be surely in sync with tcpd API, build against system header. It requires a patch.
rm include/tcpd.h
%patch1
+%patch2
%if %suse_version < 1110
%patch3
%endif
@@ -132,6 +137,11 @@
%if %suse_version > 1130
rm -r $RPM_BUILD_ROOT/usr/share/hal
%endif
+mkdir -p $RPM_BUILD_ROOT/etc/pm/sleep.d
+sed "s:@PWRFAILDIR@:%{_sysconfdir}/apcupsd:g" $RPM_BUILD_ROOT/etc/pm/sleep.d/99apcupsd
+chmod +x $RPM_BUILD_ROOT/etc/pm/sleep.d/99apcupsd
+mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
+cp apcupsd.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.apcupsd
%post
%{fillup_and_insserv apcupsd}
@@ -196,6 +206,7 @@
%{_sbindir}/rcapcupsd
%{_sbindir}/smtp
/etc/init.d/apcupsd
+/etc/pm/sleep.d/99apcupsd
%dir %{_sysconfdir}/apcupsd/
%{_sysconfdir}/apcupsd/apccontrol
%config(noreplace)%{_sysconfdir}/apcupsd/apcupsd.conf
@@ -212,6 +223,7 @@
%{apache_serverroot}/cgi-bin/upsstats.cgi
%{apache_serverroot}/cgi-bin/upsimage.cgi
%doc %{_mandir}/man?/*.*
+/var/adm/fillup-templates/sysconfig.*
%files gui
%defattr(-,root,root)
++++++ README.SUSE ++++++
--- /var/tmp/diff_new_pack.0Jwxab/_old 2011-08-29 10:55:12.000000000 +0200
+++ /var/tmp/diff_new_pack.0Jwxab/_new 2011-08-29 10:55:12.000000000 +0200
@@ -6,15 +6,15 @@
If you want to configure nut to do suspend to disk instead of shutdown
you should:
-- Verify, that suspend to disk works correctly with your desktop:
- shutdown -z +0
- (You can lose your unsaved data, if your computer does not support
- suspend.)
-
-- Properly edit your /etc/apcupsd/apccontrol: Replace -h by -z in
- shutdown command parameters.
-- Verify, that your UPS provides reasonable grant period to complete
- suspend in all situations.
+- You need pm-utils package installed.
+- Verify, that suspend to disk works correctly on your machine,
+ e. g. by pm-hibernate
+ (You can lose your unsaved data, if your computer does not hibernate
+ correctly.)
+- Verify, that your UPS provides reasonable grace period to complete
+ hibernation in all situations.
+- Use YaST Sysconfig editor and set
+ Hardware->UPS->APCUPSD_POWERFAIL_BEHAVIOR to "hibernate".
Environment with possible service timeouts
++++++ apcupsd-hibernate.patch ++++++
--- platforms/apccontrol.in
+++ platforms/apccontrol.in
@@ -20,6 +20,7 @@
APCPID=@PIDDIR@/apcupsd.pid
APCUPSD=@sbindir@/apcupsd
+HIBERNATE=/usr/sbin/pm-hibernate
SHUTDOWN=@SHUTDOWN@
SCRIPTSHELL=@SCRIPTSHELL@
SCRIPTDIR=@sysconfdir@
@@ -103,8 +104,14 @@ case "$1" in
${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
;;
doshutdown)
- echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
- ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+ . /etc/sysconfig/apcupsd
+ if test "$APCUPSD_POWERFAIL_BEHAVIOR" = "hibernate" ; then
+ echo "UPS ${2} initiated hibernation" | ${WALL}
+ $HIBERNATE
+ else
+ echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
+ ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+ fi
;;
annoyme)
echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
++++++ apcupsd-powersave.patch ++++++
--- /var/tmp/diff_new_pack.0Jwxab/_old 2011-08-29 10:55:13.000000000 +0200
+++ /var/tmp/diff_new_pack.0Jwxab/_new 2011-08-29 10:55:13.000000000 +0200
@@ -160,7 +160,7 @@
===================================================================
--- platforms/apccontrol.in.orig
+++ platforms/apccontrol.in
-@@ -24,6 +24,7 @@ SHUTDOWN=@SHUTDOWN@
+@@ -25,6 +25,7 @@ SHUTDOWN=@SHUTDOWN@
SCRIPTSHELL=@SCRIPTSHELL@
SCRIPTDIR=@sysconfdir@
WALL=wall
@@ -168,7 +168,7 @@
#
# Concatenate all output from this script to the events file
-@@ -56,18 +57,23 @@ then
+@@ -57,18 +58,23 @@ then
fi
fi
@@ -196,7 +196,7 @@
;;
#
# powerout, onbattery, offbattery, mainsback events occur
-@@ -76,47 +82,47 @@ case "$1" in
+@@ -77,53 +83,53 @@ case "$1" in
powerout)
;;
onbattery)
@@ -235,9 +235,16 @@
${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
;;
doshutdown)
-- echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
-+ notify "UPS ${2} initiated Shutdown Sequence"
- ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+ . /etc/sysconfig/apcupsd
+ if test "$APCUPSD_POWERFAIL_BEHAVIOR" = "hibernate" ; then
+- echo "UPS ${2} initiated hibernation" | ${WALL}
++ notify "UPS ${2} initiated hibernation"
+ $HIBERNATE
+ else
+- echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
++ notify "UPS ${2} initiated Shutdown Sequence"
+ ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+ fi
;;
annoyme)
- echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
++++++ apcupsd.hibernate ++++++
#!/bin/bash
. $PM_UTILS_LIBDIR/functions
case "$1" in
hibernate)
if test -f @PWRFAILDIR@/powerfail ; then
/etc/init.d/apcupsd stop
# Stopping of daemon typically needs at least 3 sec.
sleep 10
/etc/init.d/apcupsd powerdown
fi
;;
thaw)
# powerfail exists => apcupsd was running before hibernation
if test -f @PWRFAILDIR@/powerfail ; then
/etc/init.d/apcupsd start
fi
;;
*)
;;
esac
exit 0
++++++ apcupsd.sysconfig ++++++
## Path: Hardware/UPS
## Description: Defines UPS behavior
## Type: list(shutdown,hibernate)
## Default: shutdown
#
# What to do if UPS goes out of power? Shutdown or hibernate.
# Read /usr/share/doc/packages/apcupsd/README.SUSE for more.
#
APCUPSD_POWERFAIL_BEHAVIOR="shutdown"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org