When the openfire RPM is upgraded, RPM does an install first then an uninstall, therefore, %post will be executed followed by %postun
With the current spec file, chkconfig --add will be executed followed by chkconfig --del which defeats the purpose. The following patch fixes the issue:
--- openfire.spec.orig 2007-10-03 10:30:28.000000000 -0700
+++ openfire.spec 2007-10-03 10:31:05.000000000 -0700
@@ -76,8 +76,11 @@ rm -rf $RPM_BUILD_ROOT %preun
-[http:// -x "/etc/init.d/openfire" |http:// -x "/etc/init.d/openfire" ] && /etc/init.d/openfire stop
-/sbin/chkconfig --del openfire
+if [ "$1" == 0 ]
+then
+ [http:// -x "/etc/init.d/openfire" |http:// -x "/etc/init.d/openfire" ] && /etc/init.d/openfire stop
+ /sbin/chkconfig --del openfire
+fi %post /sbin/chkconfig --add openfire
This would only perform the chkconfig --del operation when the user is uninstalling the RPM.
Thanks!
Bernard