Timing issue, installing a package and then modifying one of it's files...

I have come across an unusual timing issue… I’m not sure what is causing it but it is repeatable…

Here is a single task file from part of my initial set up… (I’ve removed the AIX and 32 bit variants but they are interspersed with the 64 bit RedHat version.

Do you think there’s a background process spawned by sysstat that is modifying it’s own cron job?

If there is it’s fast enough that yum install sysstat && cat /etc/cron.d/sysstat gives me the results that I expect. It looks like the sysstat package includes a default /etc/cron.d/sysstat file that doesn’t appear to change at any point.

I’m rather confused by this, unless the install task is returning before it’s finished and I don’t know why that would happen.

Adam

Running yum manually with rpmverbosity set to debug I can see that the /etc/cron.d/sysstat file is the first one that is deployed from the RPM and the only script appears to be a postinstall script that runs chkconfig.

I’m trying a run with -vvv and dumping it to a file to see if I can see exactly where the issue lies.

Adam

My stupidity was at fault…

There is originally a commented out line in the file that ALSO matches the regexp I was using. So, my change was made to the second of two matching lines and not the first… Kind of confusing when using insertbefore…

So I have…

example line 1

line 2 example

and using line in file I insert “ansible test” before “line” and it gets put in between lines 1 and 2. i.e. after line 1 and before line 2.

thus I end up with

example line 1
ansible test

line 2 example

and not

ansible test
example line 1

line 2 example

as I was expecting… that behaviour is clearly documented for regexp but it might be worth adding a note to “insertbefore” that it will insert before the LAST line that matches the regexp.

Adam