Gentoo Archives: gentoo-dev

From: Tobias Klausmann <klausman@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Lib_users, a post-upgrade helper
Date: Wed, 28 Jul 2010 09:38:41

Short version: Upgrades happen, libs get deleted/replaced; my
script (links below) tells you what processes to restart.

Long version:

I've recently realized that many admins aren't aware of a problem
when upgrading their systems. Usually, people are told to run
revdep-rebuild and do sundry other stuff. But sometimes, a
certain point is missed: deleted-but-mapped files. Yes, we all
know that upgrading say OpenSSL or gnutls means that we should
restart all the services that use those libraries. But sometimes,
we might miss some obscure daemon or a job running in a screen
(so looking at /etc/init.d doesn't help us).

Fortunately, all the relevant information can be found in /proc:
the per-process maps file lists files (and if they're deleted)
and the cmdline file gives us the name of the processes.

So it's a simple shell onliner, right? Yes, that can be done (and
please refrain from posting your solution to that particular
exercise). But Shell onliners tend to be forgotten, and robust
they ain't, especially if you add in stuff like not listing a
deleted shmem segment or similar stuff.

To make a long posting boring: I've hacked up a Python script
that does all that and prints out a nice summary. It's available
from here:

Or, for those who want to go to the tgz directly:

Comments/suggestions appreciated.