0

we have several redhat servers which we patch from redhat satellite.

To avoid confusion, I'll use the term "host" to denote the server which is being patched.

We have a script, say, patch.sh, which we'll schedule to run in all redhat hosts (virtual machine) using "Remote command" option in Redhat satellite.

This patch.sh script runs "yum update" followed by "vmware-config-tools -d" and reboot. There's more to it, but this is just the outline.

My understanding is, "yum update" downloads all packages to /var/cache/yum/ of the host, under various sub-directories that are named based on the channels the hosts are subscribed to, and then installs the packages and remove them from there.

Have pasted the output of command "ls -lt /var/cache/yum" below for better understanding.

[root@xyzdev01]#ls -lt /var/cache/yum
total 64
drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit
drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-supplementary
drwxr-xr-x 3 root bin  4096 Mar  1 22:27 rhel-5-64bit-rhn-tools

Here under these directories, for example, say under rhel-5-64bit, there are few files along with a sub-directory called packages, where packages from this channel gets downloaded to.

Per my understanding, this packages sub-directory is empty in servers where the patching is successful.

Sometimes, what happens is, the package gets downloaded to the host, but due to some intermittent connectivity issue between Redhat satellite server and host where patching is happening (i.e) where the patch.sh script is being run, it doesn't gets installed. But when Redhat satellite server re-establishes the connection with the host, it thinks that the host is patched and proceeds with the reboot and these servers gets listed under "Completed Systems" in Redhat satellite, whereas actually the host is not patched. Here, the package stays in the /var/cache/yum/channel_name/packages without being installed.

To avoid this corner case, we're planning to implement an additional check in the patch.sh script.

I have 2 questions.

1) Is my understanding right?

2) If yes, then if i place an additional check in the script to check for **.rpms* under /var/cache/yum before it actually performs the next steps (i.e) vmware-config-tools -d and reboot, would it work?

Appreciate any suggestions and clarifications.

Thank you.

  • 2
    I would simply check the exit code of yum update. – Mark Wagner Aug 28 '14 at 20:18
  • Is there a reason you're not scheduling updates through the satellite? If you did that then the Satellite would show you which scheduled events didn't succeed. – Bratchley Aug 28 '14 at 21:30
  • I've actually never seen the error you mention actually. Any time I've deployed an update its success or failure has always shown up in the Satellite (under the Schedule tab at the top). – Bratchley Aug 28 '14 at 21:32
  • Did the Script worked, And, if possible may I know the patch.sh script you are using. I'm facing exact scenario and need to create a patch script and also need to very the patching is successful or not. Thanks. – Amer May 28 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.