0
votes

I'm trying to create a package and the install/uninstall scripts of the previous and new package must be called in a specific order.

According to http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#RPM_scriptlet_recipes, when upgrading an installed package, first the {pre,post}install scripts of the new package will run, and then the {pre,post}uninstall of the old package.

That means that at some time there will be both packages installed. How is this possible? Is the new package installed on a chroot somewhere? I can't find anything relevant.

Moreover: how can I start the service at the end of installation? If I add "service start xxx" at the post-install scriplet, then when upgrading the pre-uninstall will run which will stop the service again..

1

1 Answers

0
votes

Yes rpm does install-before-erase to prevent a window where no package is installed, which happens with erase-before-install.

Newly installed files that replace the previous files are skipped.

For uninstall scripts, you need to test $1 to differentiate between "upgrade" (where you don't want to stop a just started service) and "removal".

$1 will be zero when removing a package.

Examine similar packages with daemons using "rpm -q --scripts ..."