I am making quite some binaries, scripts etc that I want to install easily (using my own rpms). Since I want them accessible for everyone, my intuition would be to put them in /usr/bin;
- no need to change PATH
however; my executables now disappear in a pool of all the others; how can I find back all the executables I put there in an easy way. I was thinking of:
- a subdirectory in /usr/bin (I know I cannot do this; just to illustrate my thinking)
- another directory (/opt/myself/bin) and linking each executable to /usr/bin (lots of work)
- another directory (/opt/myself/bin) and linking the directory to /usr/bin (is this possible?)
what would be the "best, most linux-compliant way" to do this?
EDIT: we had a discussion on this in the company and came up with this sub-optimal option: put binaries in /usr/bin/company with a symbolic link from /usr/bin. I'm not thrilled with this solution (disussion ongoing)
Best Answer
If you bundle your binaries into your own RPMs then it's trivial to get a list of what they are and where they were installed.
Example
I would suggest putting your executables in either
/usr/bin
or/usr/local/bin
and rolling your own RPM. It's pretty trivial to do this and by managing your software deployment using an RPM you'll be able to label a bundle with a version number further easing the configuration management of your software as you deploy it.Determining which RPMs are "mine"?
You can build your RPMs using some known information that could then be agreed upon prior to doing the building. I often build packages on systems that are owned by my domain so it's trivial to find RPMs by simply searching through all the RPMs that were built on host X.mydom.com.
Example
This would be the
Build Host
line within the RPMs.The use of /usr/bin/company?
I would probably discourage the use of a location such as this. Mainly because it requires all your systems to have their
$PATH
augmented to include it and is non-standard. Customizing things has always been a "right of passage" for every wannabee Unix admin, but I always discourage it unless absolutely necessary.The biggest issue with customization's like this is that they become a burden in both maintaining your environment and in bringing new people up to speed on how to use your environment.
Can I just get a list of files from RPM?
Yes you can achieve this but it will require 2 calls to RPM. The first will build a list of packages that were built on host X.mydom.com. After getting this list you'll need to re-call RPM querying for the files owned by each of these packages. You can achieve this using this one liner: