Package: debian-goodies
Version: 0.60
Severity: wishlist
Tags: patch

As discussed here and onward:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649168#22

pid 1 inside vservers is not readable. The attached patch assumes that
checkrestart is running inside a vserver when it is not able to
read /proc/1/exe, emits a notice and just continues with its business.

In contrast to the discussion above, I've changed the default behaviour
of checkrestart back to its original one, that is, if there's an
exception reading a /proc/*/exe link, then we raise and exception
(and terminate).

Please consider this patch for inclusion.

Thanks a lot Javier for maintaining the debian-goodies package!
*t

-- System Information:
Debian Release: squeeze/sid
  APT prefers lucid-updates
  APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 'lucid')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-19-generic (SMP w/1 CPU core)
Locale: LANG=de_CH.utf8, LC_CTYPE=de_CH.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debian-goodies depends on:
ii  curl                   7.19.7-1ubuntu1.1 Get a file from an HTTP, HTTPS or 
ii  dctrl-tools [grep-dctr 2.14              Command-line tools to process Debi
ii  dialog                 1.1-20080819-1    Displays user-friendly dialog boxe
ii  perl                   5.10.1-8ubuntu2.1 Larry Wall's Practical Extraction 
ii  python                 2.6.5-0ubuntu1    An interactive high-level object-o
ii  whiptail               0.52.10-5ubuntu1  Displays user-friendly dialog boxe

Versions of packages debian-goodies recommends:
ii  lsof                 4.81.dfsg.1-1build1 List open files

Versions of packages debian-goodies suggests:
ii  popularity-contest    1.48ubuntu1        Vote for your favourite packages a
ii  xdg-utils             1.0.2-6.1ubuntu3.2 desktop integration utilities from
ii  zenity                2.30.0-0ubuntu1    Display graphical dialog boxes fro

-- no debconf information
--- /tmp/checkrestart   2012-05-24 00:37:15.147100799 +0200
+++ /usr/local/bin/checkrestart 2012-05-24 10:42:37.000000000 +0200
@@ -445,7 +445,10 @@
             self.program = os.readlink('/proc/%d/exe' % self.pid)
         except OSError, e:
             if e.errno != errno.ENOENT:
-                raise
+                if self.pid == 1:
+                    sys.stderr.write("Found unreadable pid 1. Assuming we're 
under vserver and continuing.\n")
+                else:
+                    raise
         self.program = self.cleanFile(self.program)
 
     def cleanFile(self, f):

Reply via email to