run script when specific package is updated yum-cron

Latest response

I would like to setup a rule-set where a service (tomee) is restarted when package java-1.8.0-oracle is updated when yum-cron runs every night.

So when yum update -y is executed (by yum-cron or superuser) and package java-1.8.0-oracle is updated then the service tomee1 should be restarted.

Any bright ideas?
Thank you!

Responses

There is no built-in mechanism, but you may try to do something like yum history info | grep $PACKAGE and if you'd get a line starting with Updated then you may start a command or something...

//Zdenek

Yes, as "Zdenek" there is no built-in rule or mechanism to get that done, however, you can implement a cron job . Even /var/log/yum.log file would log activities related to yum, so any packages updated would be recorded as "Updated".

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.