Snort mailing list archives

Re: Failed to Lock PID File


From: Todd Wease <twease () sourcefire com>
Date: Sat, 03 Jan 2009 10:02:30 -0500

Hi Mike,

Can you apply the attached patch which should print the cause of the
error?  Something like:

$ cp pid_lock.diff snort-2.8.2.2
$ patch -p0 < lock.diff
$ make
$ make install

Try running and posting output again and we'll try to go from there.

Thanks,
Todd


Mike Sweetser - Adhost wrote:

Hello:

I'm trying to run Snort 2.8.2.2 on a FreeBSD 7.0p5 server.  Starting
snort manually works properly, but when starting it as a daemon, I
always get the following error and Snort exits:

PID path stat checked out ok, PID path set to /var/run/
FATAL ERROR: Failed to Lock PID File "/var/run//snort_em0.pid" for PID
"3615"

I've tried different Snort configurations, different interfaces,
different PID paths - I cannot get away from this error.  Can anybody
shed any light on this?

Thank You,
Mike Sweetser

------------------------------------------------------------------------

------------------------------------------------------------------------------
  
------------------------------------------------------------------------

_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users

Index: src/util.c
===================================================================
RCS file: /usr/cvsroot/sfeng/ims/sfsnort/snort/src/util.c,v
retrieving revision 1.141
diff -p -u -r1.141 util.c
--- src/util.c  30 Nov 2008 02:14:58 -0000      1.141
+++ src/util.c  3 Jan 2009 14:45:46 -0000
@@ -920,8 +920,11 @@ void CreatePidFile(char *intf)
 
             if (fcntl(lock_fd, F_SETLK, &lock) == -1)
             {
+                int error = errno;
+
                 ClosePidFile();
-                FatalError("Failed to Lock PID File \"%s\" for PID \"%d\"\n", pv.pid_filename, pid);
+                FatalError("Failed to Lock PID File \"%s\" for PID \"%d\": %s\n",
+                           pv.pid_filename, pid, strerror(error));
             }
         }
     }
------------------------------------------------------------------------------
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users

Current thread: