diff --git a/checkrestart b/checkrestart index c8f5419..f160980 100755 --- a/checkrestart +++ b/checkrestart @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright (C) 2001 Matt Zimmerman -# Copyright (C) 2007,2010 Javier Fernandez-Sanguino +# Copyright (C) 2007,2011 Javier Fernandez-Sanguino # - included patch from Justin Pryzby # to work with the latest Lsof - modify to reduce false positives by not # complaining about deleted inodes/files under /tmp/, /var/log/, @@ -83,7 +83,7 @@ allFiles = False for o, a in opts: - if o == "-v": + if o in ("-v", "--verbose"): verbose = True elif o in ("-h", "--help"): usage() @@ -180,15 +180,13 @@ if path.startswith('/etc/init.d/'): if path.endswith('.sh'): continue - package.initscripts.append(path) + package.initscripts.add(path) # Alternatively, find init.d scripts that match the process name if len(package.initscripts) == 0: for process in package.processes: path = '/etc/init.d/' + os.path.basename(process.program) if os.path.exists(path): - package.initscripts.append(path) - # Remove duplicate inits - package.initscripts = [ u for u in package.initscripts if u not in locals()['_[1]'] ] + package.initscripts.add(path) restartable = [] nonrestartable = [] @@ -273,6 +271,9 @@ # Or about files under /tmp if f.startswith('/tmp/'): return 0 + # Or about files under /dev/shm + if f.startswith('/dev/shm/'): + return 0 # Or about files under /drm if f.startswith('/drm'): return 0 @@ -288,11 +289,18 @@ # Or /usr/lib/locale if f.startswith('/usr/lib/locale/'): return 0 + # Skip files from the user's home directories + # many processes hold temporafy files there + if f.startswith('/home/'): + return 0 # Skip automatically generated files if f.endswith('icon-theme.cache'): return 0 # Skip font files if f.startswith('/var/cache/fontconfig/'): + return 0 + # Skip Nagios Spool + if f.startswith('/var/lib/nagios3/spool/'): return 0 # Skip, if asked to, files that do not belong to any package if onlyPackageFiles: @@ -300,7 +308,10 @@ dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None) for line in dpkgProc.stdout.readlines(): if line.endswith(f): - return 0 + file_in_package = True + break + if not file_in_package: + return 0 # TODO: it should only care about library files (i.e. /lib, /usr/lib and the like) # build that check with a regexp to exclude others @@ -452,7 +463,8 @@ class Package: def __init__(self, name): self.name = name - self.initscripts = [] + # use a set, we don't need duplicates + self.initscripts = set() self.processes = [] if __name__ == '__main__': diff --git a/checkrestart.1 b/checkrestart.1 index 01c4660..8771e06 100644 --- a/checkrestart.1 +++ b/checkrestart.1 @@ -68,6 +68,20 @@ also output some false positives depending on the processes' behaviour since it does not check yet if the (deleted) files in use are really libraries. +.P +If you find a false positive in +.B checkrestart +please provide the following information when submitting a bug report: + +.IP \(em +The output of \fBcheckrestart\fP using the \fI-v\fP (verbose) option. + +.IP \(em +The output of running the following command as root: +.PP + lsof | egrep 'delete|DEL|path inode' +.PP + .P .B Checkrestart is also sensitive to the kernel version in use. And might fail to work with newer @@ -88,6 +102,7 @@ .SH COPYRIGHT AND LICENCE Copyright (C) 2001 Matt Zimmerman +Copyright (C) 2007,2010-2011 Javier Fernandez-Sanguino This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/changelog b/debian/changelog index 59fa804..2f5ac08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,28 @@ +debian-goodies (0.56) unstable; urgency=low + + * [checkrestart]: + - Use patch provided by Jörg Sommer and Piotr Kaczuba that makes the + script use a set for the initscripts information, thus making the + program work with Python 2.7 (Closes: #64397) + - Fix behaviour of -p so that it does not consider files that do + not belong to any package, thanks to Peter Eisentraut for the + patch. (Closes: #608387) + - Fix handling of --verbose option (Closes: #623168) + - Exclude /dev/shm from the deleted files check, this prevents + a false positive from some programs such as jackd2 (Closes: #595096) + - Exclude /home from the deleted files check as these + generate a number of false positives. This included: GNOME's mixer + applet, dovecot, nautilus, chromium-broswer and evolution-data-server + (Closes: #595096, #609454) + * [checkrestart.1]: + - Update the manpage to indicate what information to provide when + reporting a false positive in checkrestart + * /debmany/man/debmany.1: + - Fix typo in manpage (Closes: #600252) + + + -- Javier Fernandez-Sanguino Pen~a Sun, 09 Oct 2011 20:51:11 +0200 + debian-goodies (0.55) unstable; urgency=low * [ dglob ] Clean up bashims (Closes: #600156) diff --git a/debmany/man/debmany.1 b/debmany/man/debmany.1 index c5e80b1..583911a 100644 --- a/debmany/man/debmany.1 +++ b/debmany/man/debmany.1 @@ -38,7 +38,7 @@ If a file which must be downloaded exceeds the limit, you are asked if the download should start. Without unit the value is in bytes. You can append K, M, G or T to the value to change the unit. .TP \fB\-l lang1[,...]\fR -English manpages are displayed always. If you want more languages you can specify them here. Provide a comma separated list of the folder names in the manpgage folders (/usr/share/man) \- e.g. de,fr or "zh*" if you want to see all Chinese manpages (Simplified and Traditional Chinese as well). It is safe always to use "*" at the end of your language. +English manpages are displayed always. If you want more languages you can specify them here. Provide a comma separated list of the folder names in the manpage folders (/usr/share/man) \- e.g. de,fr or "zh*" if you want to see all Chinese manpages (Simplified and Traditional Chinese as well). It is safe always to use "*" at the end of your language. During installation automatic generated character set based versions are not available for selection. .TP \fB\-z\fR