Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 4225 - %post and %preun are run in reverse order during upgrade
%post and %preun are run in reverse order during upgrade
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 1999-07-27 13:26 EDT by Paul Iadonisi
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-07-27 16:19:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Paul Iadonisi 1999-07-27 13:26:05 EDT
I've created an rpm for VMware that stops the vmware
processes before uninstalling (the %preun script) and starts
the processes after installing (the %post script):


# Make VMware start/shutdown automatically when the machine
does it.
/sbin/chkconfig --add vmware

# Restart in the same way that vmware will be started
/etc/rc.d/init.d/vmware start

/etc/rc.d/init.d/vmware stop
# Remove autostart of vmware
if test $1 = 0
   /sbin/chkconfig --del vmware
An upgrade of this package, with no changes to either the
%post or %preun scripts, should presumably stop the vmware
process, delete it from chkconfig control and then upgrade
the package, add it to chkconfig control, and start the
vmware processes.  What happens instead is that the rpm is
upgraded first, and then the processes are started (%post
script) and lastly, the processes are stopped (%preun
script).  This looks like the wrong order, to me.
Comment 1 Paul Iadonisi 1999-07-27 13:27:59 EDT
The version of rpm is rpm-3.0.2-6.0
Comment 2 Jeff Johnson 1999-07-27 16:19:59 EDT
Rpm always installs (and runs %post) before uninstalling (and runs

Rewrite your %preun as follows:

# Remove autostart of vmware
if test $1 = 0
   /etc/rc.d/init.d/vmware stop
   /sbin/chkconfig --del vmware

Note You need to log in before you can comment on or make changes to this bug.