Gentoo Archives: gentoo-dev

From: Tobias Klausmann <klausman@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Lib_users, a post-upgrade helper
Date: Wed, 28 Jul 2010 13:24:15
Message-Id: 20100728132355.GA21361@kaini.schwarzvogel.de
In Reply to: Re: [gentoo-dev] Lib_users, a post-upgrade helper by Jeroen Roovers
1 Hi!
2
3 On Wed, 28 Jul 2010, Jeroen Roovers wrote:
4 > > To make a long posting boring: I've hacked up a Python script
5 > > that does all that and prints out a nice summary. It's available
6 > > from here:
7 > >
8 > > http://schwarzvogel.de/software-misc.shtml
9 >
10 > Is it like checkrestart[1], originally from debian-goodies but hacked
11 > to work on Gentoo Linux?
12
13 (Note: this is stream-of-conciousness, so it might be a bit
14 rambling).
15
16 It is very similar in scope, but the implementations differ a
17 lot. While lib_users has no external dependencies aside from a
18 Python interpreter, checkrestart uses lsof. While that approach
19 has the advantage of not only catching mapped files but every
20 open FD, I am thinking about implementing something similar with
21 lib_users (but using /proc/<pid>/fd/). Can someone chime in on
22 the question of dlopen()ed libs and whether they turn up as mapped
23 files?
24
25 One annoying thing about checkrestart is that it refuses to work
26 for non-root users:
27 $ checkrestart
28 This program must be run as root
29 in order to collect information about all open file descriptors
30 $
31
32 This is a /bug/ - some users might just want to know what /they/
33 have to restart.
34
35 Checkrestart doesn't have a --help function (it also has no
36 options at all, but at least displaying version info would've
37 been nice).
38
39 For a Debian package, manpage etc. are also suspiciously absent.
40
41 Checkrestart tries to tell you which init scripts are relevant. I
42 think that is neither robust nor desirable but a case of
43 over-engineering.
44
45 Checkrestart does not handle the interpreter problem at all,
46 while lib_users at least tries to give you enough information to
47 find out what to do.
48
49 I've also taken a look at the source code of checkrestart and
50 it's obvious it has been hacked to work on Gentoo. Also, it has
51 several pieces of dead code (checking for lsof output that isn't
52 ever generated, for example). Is the maintainer of the hacks
53 still around and doing updates? Its last release was in 2008. How
54 about upstream for the original checkrestart?
55
56 Or, to put it in cold, dead numbers:
57
58 $ grep -cv ^# $(which checkrestart)|wc -l
59 399
60 $ grep -cv ^# lib_users
61 106
62
63 I'll maintain lib_users anyway since I use it on my own systems,
64 so it won't go away if nobody is interested in it but me.
65
66 Regards,
67 Tobias

Replies

Subject Author
Re: [gentoo-dev] Lib_users, a post-upgrade helper Jeroen Roovers <jer@g.o>