On Wed, 23 May 2012, Tomas Pospisek wrote:
So either I'm understanding something wrong, or the blacklist feature is not
working as it should.
In the following scenario I'm in a vserver, and the problem with vservers is
that the 'init' process is weird, i.e. it does not belong to the vserver
instance itself and thus is not accessible. So checkrestart should not touch
it. So this is what I do:
# cat /etc/checkinstall.blacklist
/proc/1/exe
#
# /usr/local/bin/checkrestart -b/etc/checkinstall.blacklist
Traceback (most recent call last):
File "/usr/local/bin/checkrestart", line 503, in <module>
main()
File "/usr/local/bin/checkrestart", line 127, in main
toRestart = lsofcheck(blacklist = blacklist)
File "/usr/local/bin/checkrestart", line 246, in lsofcheck
process = processes.setdefault(data,Process(int(data)))
File "/usr/local/bin/checkrestart", line 445, in __init__
self.program = os.readlink('/proc/%d/exe' % self.pid)
OSError: [Errno 13] Permission denied: '/proc/1/exe'
So there's either something wrong with my understanding of the new -b option
or the blacklist feature is not yet perfect?
OK, I got it, so checkrestart is reading the owner's pid of each file and
then trying to find the name of the executable from the pid. Which fails
for pid 1.
So currently instead of failing as above I changed checkrestart to report
an error and to continue:
admin:~# diff -u /tmp/checkrestart /usr/local/bin/checkrestart
--- /tmp/checkrestart 2012-05-24 00:37:15.147100799 +0200
+++ /usr/local/bin/checkrestart 2012-05-24 00:24:23.000000000 +0200
@@ -445,7 +445,8 @@
self.program = os.readlink('/proc/%d/exe' % self.pid)
except OSError, e:
if e.errno != errno.ENOENT:
- raise
+ sys.stderr.write('ERROR: Failed to read %d' % self.pid)
+ #raise
self.program = self.cleanFile(self.program)
def cleanFile(self, f):
I wonder if there's a better way...
Other than that, I can report that Tollef patch works for me.
*t
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org