An admin script to check missing dependencies

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Mar 18 17:05:55 UTC 2014


On 03/18/14 15:56, Minas Dasygenis wrote:
> While I administer a number of FreeBSD Servers, I have faced the problem of an application
> failing to start, due to a missing dynamic library dependency. Furthermore, if this application
> impacts the reputation of the server, then it is mandatory to fix it as soon as possible.
> 
> The problem originates when I update a port [using portmaster], which installs a newer version of a library
> [e.g. removes the library.so.10 and installs library.so.11]. In such cases, applications
> that demand the old library stop working. Usually an "ln -s library.so.11  library.so.10"
> fixes the problem, but this means that an early detection is required.
> 
> To help myself [and other freebsd administrators], I have created a script that I execute
> it daily. This script checks all files on the system. If it finds a missing dependency it reports
> it to the user, as well as a possible fix if this is available.
> 
> This script is available at my home page at the miscellaneous section:
> 
> http://arch.icte.uowm.gr/mdasyg/misc/check_requisite_library_files.sh
> 
> 
> I am executing it on every FreeBSD server and whenever a missing library is found
> I am notified via email.
> 
> Feel free to contribute any improvements via email and I will update it.


This sort of functionality is built into pkg(8) -- see the pkg-check(8)
man page, particularly the bits about 'pkg check -b' which should be a
lot quicker than your script.

Of course 'pkg check' only covers stuff installed from packages, and it
implies you're on a pkgngified machine.  Using pkg(8) should, in any
case, make it much harder to accidentally forget to install all the
run-time dependencies you need.

While pkg(8) currently really only covers stuff that's installed from
the ports, that doesn't have to be the case.  You can, in principle,
create a pkg from any set of files on a machine -- at the moment, that's
all pretty much down to manually generating a +MANIFEST file, until some
kind person sits down and writes user tools to facilitate the process.

	Cheers,

	Matthew



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1029 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20140318/2eaabc7e/attachment.sig>


More information about the freebsd-questions mailing list