[Bug 507089] Review Request: olpc-powerd - power management for the XO laptop
bugzilla at redhat.com
bugzilla at redhat.com
Thu Jul 16 23:21:41 UTC 2009
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=507089
--- Comment #4 from Christoph Wickert <fedora at christoph-wickert.de> 2009-07-16 19:21:40 EDT ---
On the scriptlets again...
Your scripts only handle the case where one replaces ohm with powerd, but not
when upgrading powerd. The problem is the order: Upon an upgrade, %preun of the
old package runs after %post of the new package, see
https://fedoraproject.org/wiki/Packaging/ScriptletSnippets#Scriptlet_Ordering
So what we get is:
initctl start powerd
initctl start olpc-switchd
...
initctl stop olpc-switchd
initctl stop powerd
This cannot work! How about this:
# Only on install
%post
if [ $1 = 1 ] ; then
if test -e /etc/init.d/ohmd ; then
service ohmd stop >/dev/null 2>&1
chkconfig ohmd off
fi
initctl -q start powerd
initctl -q start olpc-switchd
fi
# Only on uninstall
%preun
if [ $1 = 0 ] ; then
initctl stop -q olpc-switchd
initctl stop -q powerd
if test -e /etc/init.d/ohmd
then
/sbin/service ohmd start >/dev/null 2>&1
/sbin/chkconfig ohmd on
fi
fi
# Restart after upgrade
%postun
if [ "$1" -ge "1" ] ; then
initctl stop -q olpc-switchd
initctl stop -q powerd
initctl start -q powerd
initctl start -q olpc-switchd
fi
--
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Fedora-package-review
mailing list