Loads of stale zero byte tmp files?

Mark Sapiro mark at msapiro.net
Wed May 23 01:15:10 IST 2012


Remco Barendse wrote:

I have an issue with MailScanner-4.84.5-2 / SpamAss on CentOS 6.2. The
setup seems to be working ok but i have an issue on 2 boxes that temp
files do not get deleted.  In /tmp stuff like this is piling up quickly:
-rw-------. 1 root    root         94 May 20 22:55 K2M0qbNwv6
-rw-------. 1 root    root          0 May 21 05:08 tmp.1t3DQ6ZFaU
-rw-------. 1 root    root          0 May 21 06:14 tmp.9ZRV7VB41Y
-rw-------. 1 root    root          0 May 21 04:17 tmp.DmqX7lvDJS
-rw-------. 1 root    root          0 May 21 04:17 tmp.HwtJIyJImI
-rw-------. 1 root    root          0 May 21 06:14 tmp.MdrrIsMqGa
-rw-------. 1 root    root          0 May 21 05:08 tmp.ToMnIIFMf1


The above files are left behind by the
/etc/cron.hourly/update_virus_scanners process. This runs
/usr/sbin/update_virus_scanners every hour which in turn goes through
all the configured virus scanners checking if the scanner is installed
and then, if it is, running its update process.

Two of the check processes:

/usr/lib/MailScanner/bitdefender-wrapper
/usr/lib/MailScanner/clamav-wrapper

when called with -IsItInstalled create these files and don't remove
them. A third,

/usr/lib/MailScanner/kaspersky-wrapper

only creates the file and fails to remove it when called with the
-IsItInstalled option and the kaspersky package is installed.

The attached MS.patch file will fix this.


and in /var/spool/MailScanner/incoming/SpamAssassin-Temp :
-rw-------. 1 root root 0 May 21 06:31 MailScanner.UfuR0E
-rw-------. 1 root root 0 May 21 05:58 MailScanner.vpJ3tf
-rw-------. 1 root root 0 May 21 03:34 MailScanner.zmZPln
-rw-------. 1 root root 0 May 21 03:34 MailScanner.zTSxkI


One of the above files is created on my system every time MailScanner
starts a new child process, i.e. every time a child dies of old age and
is restarted. Also, if I restart MailScanner itself, I get an additional
one created.

I'm not sure where the actual create and/or failure to remove is.


-rw-------. 1 root root 0 May 21 05:42 tmp.1t1IUXAFLV
-rw-------. 1 root root 0 May 21 05:42 tmp.296NAlpKdS
-rw-------. 1 root root 0 May 21 03:35 tmp.3cDHk7cwub
-rw-------. 1 root root 0 May 21 03:20 tmp.3eimiawowx


I see these rarely. I don't know what leaves them.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-------------- next part --------------
--- /usr/lib/MailScanner/bitdefender-wrapper.orig	2012-05-22 15:55:44.000000000 -0700
+++ /usr/lib/MailScanner/bitdefender-wrapper	2012-05-22 15:58:48.000000000 -0700
@@ -55,6 +55,7 @@
 fi
 
 if [ "x$1" = "x-IsItInstalled" ]; then
+  rm -f $LogFile
   [ -x ${PackageDir}/$prog ] && exit 0
   exit 1
 fi
--- /usr/lib/MailScanner/clamav-wrapper.orig	2012-05-22 15:54:17.000000000 -0700
+++ /usr/lib/MailScanner/clamav-wrapper	2012-05-22 16:00:31.000000000 -0700
@@ -132,6 +132,7 @@
 fi
 
 if [ "x$1" = "x-IsItInstalled" ]; then
+  rm -f ${TempDir}
   [ -x $ClamScan ] && exit 0
   exit 1
 fi
--- /usr/lib/MailScanner/kaspersky-wrapper.orig	2012-05-22 17:01:21.000000000 -0700
+++ /usr/lib/MailScanner/kaspersky-wrapper	2012-05-22 17:03:27.000000000 -0700
@@ -45,6 +45,7 @@
   Report=$(mktemp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
   ScanOptions="-xp -i0" # Don't report progress, don't attempt to clean
   if [ "x$1" = "x-IsItInstalled" ]; then
+    rm -f $Report
     exit 0
   fi
 
@@ -64,6 +65,7 @@
   Report=$(mktemp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
   ScanOptions="-xp -i0" # Don't report progress, don't attempt to clean
   if [ "x$1" = "x-IsItInstalled" ]; then
+    rm -f $Report
     exit 0
   fi
 
@@ -83,6 +85,7 @@
   Report=$(mktemp) || { echo "$0: Cannot create temporary file" >&2; exit 1; }
   ScanOptions="-xp -i0" # Don't report progress, don't attempt to clean
   if [ "x$1" = "x-IsItInstalled" ]; then
+    rm -f $Report
     exit 0
   fi
 


More information about the MailScanner mailing list