It's quite common to have security updates arise for various system libraries on servers I administer (Linux, mostly Debian and Ubuntu). I can run the updates easily enough, but that often leaves running applications still linked against the old versions of the libraries and potentially still vulnerable.
Is there a way to list running applications which are linked against a particular library (probably before running the update), or (much better) to list applications which are linked against library files that are no longer linked in the file system? (run after the update)
It would be useful to have something I could run in advance of updates, but that doesn't seem to fit into a system maintenance workflow all that easily, and it would be easy to not do it consistently. It would be better I think to regularly check for running executables linked against libraries that are no longer present in the system. Maybe that can be pulled out of /proc somehow?
[For about a zillion extra points, provide a solution which also finds such situations for processes running inside containers, virtualenv, etc]