Codebase list debian-goodies / 66b4403
Imported Debian version 0.56 Javier Fernandez-Sanguino 12 years ago
4 changed file(s) with 61 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
00 #!/usr/bin/python
11
22 # Copyright (C) 2001 Matt Zimmerman <mdz@debian.org>
3 # Copyright (C) 2007,2010 Javier Fernandez-Sanguino <jfs@debian.org>
3 # Copyright (C) 2007,2011 Javier Fernandez-Sanguino <jfs@debian.org>
44 # - included patch from Justin Pryzby <justinpryzby_AT_users.sourceforge.net>
55 # to work with the latest Lsof - modify to reduce false positives by not
66 # complaining about deleted inodes/files under /tmp/, /var/log/,
8282 allFiles = False
8383
8484 for o, a in opts:
85 if o == "-v":
85 if o in ("-v", "--verbose"):
8686 verbose = True
8787 elif o in ("-h", "--help"):
8888 usage()
179179 if path.startswith('/etc/init.d/'):
180180 if path.endswith('.sh'):
181181 continue
182 package.initscripts.append(path)
182 package.initscripts.add(path)
183183 # Alternatively, find init.d scripts that match the process name
184184 if len(package.initscripts) == 0:
185185 for process in package.processes:
186186 path = '/etc/init.d/' + os.path.basename(process.program)
187187 if os.path.exists(path):
188 package.initscripts.append(path)
189 # Remove duplicate inits
190 package.initscripts = [ u for u in package.initscripts if u not in locals()['_[1]'] ]
188 package.initscripts.add(path)
191189
192190 restartable = []
193191 nonrestartable = []
272270 # Or about files under /tmp
273271 if f.startswith('/tmp/'):
274272 return 0
273 # Or about files under /dev/shm
274 if f.startswith('/dev/shm/'):
275 return 0
275276 # Or about files under /drm
276277 if f.startswith('/drm'):
277278 return 0
287288 # Or /usr/lib/locale
288289 if f.startswith('/usr/lib/locale/'):
289290 return 0
291 # Skip files from the user's home directories
292 # many processes hold temporafy files there
293 if f.startswith('/home/'):
294 return 0
290295 # Skip automatically generated files
291296 if f.endswith('icon-theme.cache'):
292297 return 0
293298 # Skip font files
294299 if f.startswith('/var/cache/fontconfig/'):
300 return 0
301 # Skip Nagios Spool
302 if f.startswith('/var/lib/nagios3/spool/'):
295303 return 0
296304 # Skip, if asked to, files that do not belong to any package
297305 if onlyPackageFiles:
299307 dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None)
300308 for line in dpkgProc.stdout.readlines():
301309 if line.endswith(f):
302 return 0
310 file_in_package = True
311 break
312 if not file_in_package:
313 return 0
303314
304315 # TODO: it should only care about library files (i.e. /lib, /usr/lib and the like)
305316 # build that check with a regexp to exclude others
451462 class Package:
452463 def __init__(self, name):
453464 self.name = name
454 self.initscripts = []
465 # use a set, we don't need duplicates
466 self.initscripts = set()
455467 self.processes = []
456468
457469 if __name__ == '__main__':
6767 also output some false positives depending on the processes' behaviour since
6868 it does not check yet if the (deleted) files in use are really libraries.
6969
70 .P
71 If you find a false positive in
72 .B checkrestart
73 please provide the following information when submitting a bug report:
74
75 .IP \(em
76 The output of \fBcheckrestart\fP using the \fI-v\fP (verbose) option.
77
78 .IP \(em
79 The output of running the following command as root:
80 .PP
81 lsof | egrep 'delete|DEL|path inode'
82 .PP
83
7084 .P
7185 .B Checkrestart
7286 is also sensitive to the kernel version in use. And might fail to work with newer
87101 .SH COPYRIGHT AND LICENCE
88102
89103 Copyright (C) 2001 Matt Zimmerman <mdz@debian.org>
104 Copyright (C) 2007,2010-2011 Javier Fernandez-Sanguino <jfs@debian.org>
90105
91106 This program is free software; you can redistribute it and/or modify
92107 it under the terms of the GNU General Public License as published by
0 debian-goodies (0.56) unstable; urgency=low
1
2 * [checkrestart]:
3 - Use patch provided by Jörg Sommer and Piotr Kaczuba that makes the
4 script use a set for the initscripts information, thus making the
5 program work with Python 2.7 (Closes: #64397)
6 - Fix behaviour of -p so that it does not consider files that do
7 not belong to any package, thanks to Peter Eisentraut for the
8 patch. (Closes: #608387)
9 - Fix handling of --verbose option (Closes: #623168)
10 - Exclude /dev/shm from the deleted files check, this prevents
11 a false positive from some programs such as jackd2 (Closes: #595096)
12 - Exclude /home from the deleted files check as these
13 generate a number of false positives. This included: GNOME's mixer
14 applet, dovecot, nautilus, chromium-broswer and evolution-data-server
15 (Closes: #595096, #609454)
16 * [checkrestart.1]:
17 - Update the manpage to indicate what information to provide when
18 reporting a false positive in checkrestart
19 * /debmany/man/debmany.1:
20 - Fix typo in manpage (Closes: #600252)
21
22
23 -- Javier Fernandez-Sanguino Pen~a <jfs@debian.org> Sun, 09 Oct 2011 20:51:11 +0200
24
025 debian-goodies (0.55) unstable; urgency=low
126
227 * [ dglob ] Clean up bashims (Closes: #600156)
3737 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.
3838 .TP
3939 \fB\-l lang1[,...]\fR
40 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.
40 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.
4141 During installation automatic generated character set based versions are not available for selection.
4242 .TP
4343 \fB\-z\fR