0

We have an rpm to our project and that contains pre and post install scripts.

While the post install script is still running, yum list is showing the package name in it.

sudo yum list installed project-name

or

sudo yum list | grep project-name

So, is there anyway to check if the package is installed completely, including the post install script?

Kalel
  • 134
  • 1
  • 4
  • 16
  • What these post scripts do? You can check by observing the result of the checks. – Romeo Ninov Aug 01 '22 at 12:46
  • post scripts actually installs a python version specific to the project and create a pipx environment for that. – Kalel Aug 01 '22 at 15:03
  • Why do not add this python version as required for the package? – Romeo Ninov Aug 01 '22 at 15:31
  • that is one particular step... not the whole. there are many other steps in it. And there is no rpm for 3.9.5 to set it as dependency for rpm. ANy option to check whther through any command, the post script is completed or not? – Kalel Aug 01 '22 at 15:57

1 Answers1

0

AFAIK In the RPM world the %post script is considered to execute after the package has been installed.

At the point the contents of the package have been copied to their location on disk and RPM database has been updated and dependent tools such as yum and dnf consider the package "installed".

That is why by convention the %post script can't fail (or should never result in an exit code other than 0) See the packaging guidelines

Non-zero exit codes from scriptlets can break installs/upgrades/erases such that no further actions will be taken for that package in a transaction (see Ordering), which may for example prevent an old version of a package from being erased on upgrades, leaving behind duplicate rpmdb entries and possibly stale, unowned files on the filesystem.

One solution for when you want to know if the package is installed correctly, is to add a %verifyscript section that can confirm if the %post script did the right thing(s) and run rpm --verify [package]

  • THank you, but my question not about checking whether it is properly installed or not. After the installation step, we have some test cases to execute and they are failing as the post installation is still running. So if we have a proper check to see whether it is completed, we can execute test scripts after that – Kalel Aug 01 '22 at 11:40