[CentOS] Trigger after yum update

Wed Jul 21 16:34:49 UTC 2010
Ned Slider <ned at unixmail.co.uk>

On 21/07/10 14:50, przemolicc at poczta.fm wrote:
> Hello,
>
> we have installed non-repository based software on our centos servers (e.g. vmware tools).
> Each time we do 'yum update' we have to run several scripts to check if these software
> works after update.
> Sometimes we forget ...
> It it possible to configure any sort of triggers which will
> run automatically after 'yum update' ?
> I'd like to avoid writing shell wrappers for yum and looking for yum-way solution ;-)
>
> Regards
> Przemyslaw Bak (przemol)
>

How about using RPM's %triggerin scriptlet?

http://www.rpm.org/api/4.4.2.2/triggers.html
http://www.ibm.com/developerworks/linux/library/l-rpm2/

For example, you could create a dummy rpm package containing a 
%triggerin scriptlet to run your scripts in the event that package foo 
gets installed/updated.

Lets take vmware as an example (although it's probably not a very good 
example). I assume you need to run vmware-config.pl after each kernel 
update and you sometime forget to do that. You could build and install a 
dummy package that contains a %triggerin scriptlet that triggers on 
installation of the package kernel. In an ideal world the %triggerin 
scriptlet would simply run /usr/bin/vmware-config.pl, but as that script 
requires user interaction, you'd probably have to call it with the 
--default flag to provide the default answers to all questions. 
Alternatively, you might decide not to run the vmware-config.pl script 
automatically but rather send an email to root or something else to 
remind you to run it.

Is that the type of solution you're looking for?