Hi! On Wed, 28 Jul 2010, Jeroen Roovers wrote: > > 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: > > > > http://schwarzvogel.de/software-misc.shtml > > Is it like checkrestart[1], originally from debian-goodies but hacked > to work on Gentoo Linux?
(Note: this is stream-of-conciousness, so it might be a bit rambling). It is very similar in scope, but the implementations differ a lot. While lib_users has no external dependencies aside from a Python interpreter, checkrestart uses lsof. While that approach has the advantage of not only catching mapped files but every open FD, I am thinking about implementing something similar with lib_users (but using /proc/<pid>/fd/). Can someone chime in on the question of dlopen()ed libs and whether they turn up as mapped files? One annoying thing about checkrestart is that it refuses to work for non-root users: $ checkrestart This program must be run as root in order to collect information about all open file descriptors $ This is a /bug/ - some users might just want to know what /they/ have to restart. Checkrestart doesn't have a --help function (it also has no options at all, but at least displaying version info would've been nice). For a Debian package, manpage etc. are also suspiciously absent. Checkrestart tries to tell you which init scripts are relevant. I think that is neither robust nor desirable but a case of over-engineering. Checkrestart does not handle the interpreter problem at all, while lib_users at least tries to give you enough information to find out what to do. I've also taken a look at the source code of checkrestart and it's obvious it has been hacked to work on Gentoo. Also, it has several pieces of dead code (checking for lsof output that isn't ever generated, for example). Is the maintainer of the hacks still around and doing updates? Its last release was in 2008. How about upstream for the original checkrestart? Or, to put it in cold, dead numbers: $ grep -cv ^# $(which checkrestart)|wc -l 399 $ grep -cv ^# lib_users 106 I'll maintain lib_users anyway since I use it on my own systems, so it won't go away if nobody is interested in it but me. Regards, Tobias
