Re: [389-devel] Please review: auto upgrade during rpm posttrans

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/05/2009 07:37 PM, Rich Megginson wrote:
It is a problem that upgrade is not run automatically during rpm installation.  It causes problems for other packages that depend on 389.  This fix allows rpm to run the upgrade script.  Some notes:
* had to write scriptlets in lua to allow data to be passed among different phases - %posttrans does not know if it is being run as a fresh install or an upgrade, so we have to get that information from %post to pass to %posttrans
* upgrade must be run in posttrans - in %post, the old package that is being upgraded will still be around - this includes the old schema in the schema dir - the update script assumes the contents of the schema dir are correct and current - so we have to wait until %posttrans when the schema dir will contain only the new schema
* the upgrade script can only run non-interactively if the servers are all shutdown first - so we have to shutdown the servers, run the upgrade, then start the servers back up - however, if the user did not want certain servers to be running, we first get a list of the running servers, and only start those back up after the upgrade


I believe you need to add something like the following since you added the new dirsrv-snmp init script to the package:

%post
os.execute('/sbin/chkconfig --add %{pkgname}')

%postun
/sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || :
/sbin/chkconfig --del %{pkgname}-snmp


Other than that, it looks good.
--
389-devel mailing list
389-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-devel
  

--
389-devel mailing list
389-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-devel

[Index of Archives]     [Fedora Directory Announce]     [Fedora Users]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Review]     [Fedora Art]     [Fedora Music]     [Fedora Packaging]     [CentOS]     [Fedora SELinux]     [Big List of Linux Books]     [KDE Users]     [Fedora Art]     [Fedora Docs]

  Powered by Linux