0

We had troubles since our application run during rpm installation.

In the future we would like to know if the rpm command is currently installing rpm packages.

Maybe I am missing the matching keywords, but I could not find a way to detect this with my favourite search engine.

How to detect if a rpm install is currently running?

guettli
  • 3,591
  • 17
  • 72
  • 123

1 Answers1

0

I guess here must be some kind of lock file, but both zypper and rpm can be installing new packages; and they detect whether the other program is trying to do something. A very simplistic approach might be:

if pgrep rpm || pgrep zypper
then
    echo "won't run since rpms are being installed"
    exit
fi
Chris Maes
  • 570
  • 2
  • 9