I am about to develop a little script to gather information for a chroot-jail.
In my case this looks (at the first glance) pretty simple: The application has a clean rpm-install and did install almost all files into a sub-directory of /opt.
My idea is:
- Do a find of all binaries
- Check their library-dependencies
- Record the results into a list
- Do a rsync of that list into the chroot-target-directory before startup of the application
Now I wonder - ist there any script around that already does such a job (perl/bash/python)?
So far I found only specialized solutions for single applications (like sftp-chroot).
Although is does not matter (imho) - OS is CentOS 5 x86_64 current minor release and patch-level.
rpm -ql is IMHO not generic enough, since it will only cover rpm-based distributions. The mention of the "clean install" above was just to mention that the files of the software are not distributed across the whole file-system. So my starting point is - at the moment - a
find /opt/directory/... that should work on almost any system (even not Linux).