From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20040805 Description of problem: I tried to upgrade bind-9.2.4-EL3_10 to bind-9.2.4rc7-12_EL3 and found out several errors from bind.spec. bind-9.2.4-EL3_10 has %postun script which doesn't have required check for upgrade and it will remove user and group named, and stop named service, and run /sbin/chkconfig --del named resulting knowledge of state of bind is lost and can't be restored automatically because %postun script is run last, after 9.2.4rc7-12_EL3 is installed. I added patch to add %triggerin and %triggerpostun to save previous state of bind at beginning of upgrade and then restore it after %postun script of 10:9.2.4-EL3_10 is run. patch is against 9.2.4rc7-12_EL3 bind.spec. That patch makes it safe to upgrade automatically from 10:9.2.4-EL3_10 to later version. Version-Release number of selected component (if applicable): bind-9.2.4-EL3_10, bind-9.2.4rc7-12_EL3 How reproducible: Always Steps to Reproduce: 1. upgrade from bind-9.2.4-EL3_10 to bind-9.2.4rc7-12_EL3 Actual Results: service named ist stopped. knowledge about former named state is lost. Additional info:
Created attachment 104225 [details] Triggers for safe upgrade from bind-9.2.4-EL3_10 to later version Patch add %triggerin -- bind = 10:9.2.4-EL3_10 to save former state of named service and %triggerpostun -- bind = 10:9.2.4-EL3_10 to restore former state of named.
Created attachment 104226 [details] Fix several minor problems in bind-9.2.4rc7-12_EL3 spec Some dirs were not labeled properly being %dir so rpm complined about 2 or more instances of same file. Hide service named condrestart output on several places. Added version check to %triggerpostun -p bind-chroot. It's not necessary to run this every time on bind-chroot upgrade.
The major problems caused by bind-9.2.4-EL3_10 were fixed in the latest bind release for RHEL-3: 20:bind-9.2.4-1_EL3 - this was not only lack of 'if [ "$1" -eq 0 ]' around bind's %postun, but more disastrously around 'bind-chroot's %postun, which resulted in configuration files being moved out of the chroot. bind-9.2.4-1_EL3 is baselined off the new ISC BIND 9.2.4 (final release) . This will be in RHEL-3-U4 , and is now available from : http://people.redhat.com/~jvdias/bind/RHEL-3/ Thanks for pointing out the other minor issues with the spec file - they will be fixed in the next release, but do not warrant a complete respin.
Hmmh. My patches had one minor problem I found when installed package to new system. several minor tweaks to bind.spec patch moves /sbin/chkconfig --add named to wrong place. It should move it only one line up, like: %post /sbin/chkconfig --add named if [ $1 = 1 ]; then is correct place, not %pre Sorry, my bug :-)