From owner-freebsd-questions@FreeBSD.ORG Tue Mar 18 17:05:55 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81417B46 for ; Tue, 18 Mar 2014 17:05:55 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA2CEBA for ; Tue, 18 Mar 2014 17:05:54 +0000 (UTC) Received: from ox-dell39.ox.adestra.com (no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged)) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.8/8.14.8) with ESMTP id s2IH5moB035640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 18 Mar 2014 17:05:48 GMT (envelope-from m.seaman@infracaninophile.co.uk) DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s2IH5moB035640 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1395162348; bh=hehkHJBImNfdzHz7928oldJY33KRxNOopgpfPTdIBwg=; h=Date:From:To:Subject:References:In-Reply-To; z=Date:=20Tue,=2018=20Mar=202014=2017:05:38=20+0000|From:=20Matthew =20Seaman=20|To:=20freebsd-questi ons@freebsd.org|Subject:=20Re:=20An=20admin=20script=20to=20check= 20missing=20dependencies|References:=20<20140318155612.GA84624@big b5.homeftp.net>|In-Reply-To:=20<20140318155612.GA84624@bigb5.homef tp.net>; b=oke9gXfXp6IMIC9mo5uK2P78uELYZW46lSzoFKXre0hGMbTX+VVph3SnGH9wiCe0u JWNBKO8QxM21r/zA1sczjNUdkjLtvX2UsHaTAuNNKc4zMo1YkfsFPzVhkPJxK+NRH4 u+FK3DJj17ZgCb5jqGa85RhSOB0QjWmcZXYIEipQ= X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged) claimed to be ox-dell39.ox.adestra.com Message-ID: <53287CE2.20209@infracaninophile.co.uk> Date: Tue, 18 Mar 2014 17:05:38 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: An admin script to check missing dependencies References: <20140318155612.GA84624@bigb5.homeftp.net> In-Reply-To: <20140318155612.GA84624@bigb5.homeftp.net> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ko5TOoWHpqvt4P5KU8Ue4w9Ruf4RglOI0" X-Virus-Scanned: clamav-milter 0.98.1 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RDNS_NONE autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 17:05:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ko5TOoWHpqvt4P5KU8Ue4w9Ruf4RglOI0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/18/14 15:56, Minas Dasygenis wrote: > While I administer a number of FreeBSD Servers, I have faced the proble= m of an application > failing to start, due to a missing dynamic library dependency. Furtherm= ore, if this application > impacts the reputation of the server, then it is mandatory to fix it as= soon as possible. >=20 > The problem originates when I update a port [using portmaster], which i= nstalls a newer version of a library > [e.g. removes the library.so.10 and installs library.so.11]. In such ca= ses, 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. >=20 > To help myself [and other freebsd administrators], I have created a scr= ipt that I execute > it daily. This script checks all files on the system. If it finds a mis= sing dependency it reports > it to the user, as well as a possible fix if this is available. >=20 > This script is available at my home page at the miscellaneous section: >=20 > http://arch.icte.uowm.gr/mdasyg/misc/check_requisite_library_files.sh >=20 >=20 > I am executing it on every FreeBSD server and whenever a missing librar= y is found > I am notified via email. >=20 > Feel free to contribute any improvements via email and I will update it= =2E 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 --Ko5TOoWHpqvt4P5KU8Ue4w9Ruf4RglOI0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTKHzrXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTntJgQALc7hWH+LCOg5hvGLfwaMWEs w/SPfEmK66jbeTIudWaiN9+Ms4vlxrOUhMdOGocXXp8uV7yxU6vCsEFlqgqpF84S 4tL3FftP+qTDKqWCsOvIVAfDSyKTcvUCrNU4TUbUxopeODK73h3ElNV3zARBghRu PELjese0Z1EKbaagXrOZHu7IvMLxS73wczbzsFUGmcam9GnA0gVaVdlxHXnrlguj lOo4r4a6IyImG1nhoLIM7rkK5WTIv09GTAiuxJM92oV00mAisTwbHGfUUfPVuZHC 6bjLetyTfJ2TD8JN8JhMUNta65c3AodPZ4hAwhbOo/bbbhkjck3OuCvMbopmjxCh 5kuI5pq1skx9LHznfGzAWLem/gdnjJzp2EtLkh11GlAewCdC3FD0m6cdLZd0Raxz ku7mQv5Y+gjTFGwTrKOuva5wDkTv5m3AWcDUdCDZ/zz7sBrVNXT7QzQ9T39haKJ1 ojacPYzZo9o4JRWDj05+7BXOThF76nDFhx4Ogjb1ltoW3lVlA9sl460G1zrJKT2v AQ73qVvaaQCirgKkYUeWe0tmVYOF8G7S6bFrXRyfQEGLEazyOfor42RptnEZYjbh cNgUfu6/sBng/Gm8OA0B8GmpjhxV0KD4G98GdUWzVKZf3P63YEbHk6vIgPUXdfai txmBy1YeT+TXG5rphEer =K3ya -----END PGP SIGNATURE----- --Ko5TOoWHpqvt4P5KU8Ue4w9Ruf4RglOI0--