SophosBusy.lock ownership problem

Julian Field mailscanner at ecs.soton.ac.uk
Sat May 10 15:37:14 IST 2003


Here is a patch for /usr/lib/MailScanner/MailScanner/SweepViruses.pm that
should solve this problem.
This will of course be included in the next release.
Also please make sure you are actually using the new
/usr/lib/MailScanner/*-autoupdate scripts. If there are any *.rpmnew files
in that dir then please rename them over the top of the old ones (there is
a script on the downloads page that will help you do this automatically).

--- SweepViruses.pm     2003-05-09 23:17:47.000000000 +0100
+++ SweepViruses.pm.new 2003-05-10 15:34:32.000000000 +0100
@@ -598,11 +598,15 @@

    # Check that the virus checker files aren't currently being updated,
    # and wait if they are.
-  open($Lock, ">$VirusLock")
-    or MailScanner::Log::DieLog("Cannot create $VirusLock, $!");
+  if (open($Lock, ">$VirusLock")) {
+    print $Lock  "Virus checker locked for " .
+          ($disinfect?"disinfect":"scann") . "ing by $scanner $$\n";
+  } else {
+    #The lock file already exists, so just open for reading
+    open($Lock, "<$VirusLock")
+      or MailScanner::Log::WarnLog("Cannot lock $VirusLock, $!");
+  }
    flock($Lock, $LOCK_SH);
-  print $Lock  "Virus checker locked for " .
-        ($disinfect?"disinfect":"scann") . "ing by $scanner $$\n";

    MailScanner::Log::DebugLog("Commencing " .
          ($disinfect?"disinfect":"scann") . "ing by $scanner...");


At 15:20 10/05/2003, you wrote:
>Hi,
>I'm running mailscanner-4.20-3/Exim3.36/Sophos3.68 on RH7.3. Once in a
>while, the /tmp/SophosBusy.lock file gets created with root.root
>ownership. This causes problems as I run MS as exim.exim so an old
>/tmp/SophosBusy.lock with root.root ownership can't be removed. Here's a
>bit of the log:
>
>May 10 04:59:28 qcfl MailScanner[17357]: Virus and Content Scanning:
>Starting
>May 10 04:59:28 qcfl MailScanner[17357]: Cannot create
>/tmp/SophosBusy.lock, Permission denied
>
>Am I missing a config setting somewhere? MS was installed from RPM.
>
>Thanks,
>Stephen

--
Julian Field
www.MailScanner.info
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support



More information about the MailScanner mailing list