Package: debian-goodies
Version: 0.64

Hello,

The checkrestart utility in debian-goodies will falsly report nginx
to be restarted on temporary files deletion

$ checkrestart -v
Found 1 processes using old versions of upgraded files
(1 distinct program)
[DEBUG] Process /usr/sbin/nginx (PID: 1936)
List of deleted files in use:
        /var/lib/nginx/body/0000001871 (deleted)
[DEBUG] Running:['dpkg-query', '--search', '/usr/sbin/nginx']
[DEBUG] Reading line from dpkg-query: nginx: /usr/sbin/nginx

[DEBUG] Found package nginx for program /usr/sbin/nginx
(1 distinct packages)
[DEBUG] Running:['dpkg-query', '--listfiles', 'nginx']

Of these, 1 seem to contain systemd service definitions or init scripts
which can be used to restart them.
The following packages seem to have definitions that could be used
to restart their services:
nginx:
        1936    /usr/sbin/nginx
These are the initd scripts:
service nginx restart

I suggest to skip /var/lib/nginx from the list of processed files.
Here is the patch:

diff --git a/checkrestart b/checkrestart
index 42a9574..5d3adb5 100755
--- a/checkrestart
+++ b/checkrestart
@@ -514,6 +514,9 @@ def isdeletedFile (f, blacklist = None):
     # Skip Postgresql files
     if f.startswith('/var/lib/postgresql/'):
         return 0
+    # Skip temporary Nginx files
+    if f.startswith('/var/lib/nginx/'):
+        return 0
     # Skip VDR lib files
     if f.startswith('/var/lib/vdr/'):
         return 0

Reply via email to