Open Grieves

Open Grieves

Assimilate quickly!

You must comply!

Packaging BMC Patrol Agent as a RPM for Red Hat Enterprise Linux

Out of troublePosted by Magnus Glantz 2015-06-12 12:11:42
Yes, you read it correctly. It can be done and I've done it for the past years. So, here's some heads up and tips on doing it. Also, if you are an employee of BMC and are working with Patrol, feel free to contact me to get the actual spec file. Your current way of delivering the Patrol Agent is hopelessly backwards and outdated and is a good reason for NOT using Patrol for monitoring.

Do a 'find / >list.of.files' before installing, then install Patrol, then do 'updatedb; find / >new.list.of.files' and compare the two for an indication of what to package.

A) Difficult question, depends on what you are using and for what OS you are packaging for, but I, having removed a lot of unnecessary stuff, ended up with a RPM that's about 150 MB and that installs in seconds. If you are too lazy to find out what to package, here's a list of stuff that I use for Red Hat Enterprise Linux 7.1:

Heads up:
You have to set 'AutoReqProv: no' or you'll pull in loads of dependencies that you do not want.

2) Create symlinks for Patrol to start up.

3) You need to solve a gcc prelink issue like below in %post:
# This means that you should not package these files. This is to solve a prelink issue with the versions that BMC delivers that prevents packaging.
ln -s /usr/lib64/ /usr/lib/bmc/gcc-3.4.4/rhel-6-amd64-64/
ln -s /lib64/ /usr/lib/bmc/gcc-3.4.4/rhel-6-amd64-64/

4) Possibly, in RHEL7 you may have to do the following in %post for the Agent to start up.
ln -s /usr/lib64/ /usr/lib64/

5) You need to not package /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/3rd_party_files/gzip and instead in %post do:
ln -n /usr/bin/gzip /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/3rd_party_files/gzip
..or the RPM build will bail out with a cpio error regarding md5 sum mismatch.

6) Don't forget to specify permissions for dcm and bgs stuff.
%attr(6755,root,patrol) /patrol/Patrol3/Linux-2-6-x86-64-nptl/bin/PatrolAgent
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/udrprovider
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/dcm
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgsXtender
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgssd.exe
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgsagent_stop
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgsagent_start
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgsagent
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/best1collect.exe
%attr(6555,patrol,patrol) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/b1mgrdmon
%attr(6555,root,root) /patrol/Patrol3/Linux-2-6-x86-64/best1/9.5.00/bgs/bin/bgscollect

7) You need to package all the symlinks as well (or go through the pain of creating and deleting them in %post %postun. If you keep everything in a version handling system. SVN may require you to use the "--no-ignore" option when doing svn add.

  • Comments(0)//