On Sat, Aug 23, 2003 at 09:22:08PM +0200, Tomasz Kojm wrote: > On Fri, 22 Aug 2003 22:23:00 +0200 > Thomas Lamy <[EMAIL PROTECTED]> wrote: > > > You should stop clamd cleanly - eg. by sending the SIGTERM signal. > > > Best regards, > > > Tomasz Kojm > > What about the following pseudo-code at startup of clamd (instead of > > failing): > > if (file exists(UNIX_SOCKET)) { > > if (connect(UNIX_SOCKET) != ERROR) { > > die ("Socket already exists"); > > } > > warn ("Socket already exists but is not connected - unclean > > shutdown?"); unlink (UNIX_SOCKET); > > } > OK, but this will be an option (something like FixSocket or so) in > clamav.conf.
I believe the proper option is to use the properties of bind() as they were intended to be used. bind() should only succeed if no other file descriptors in the system are bound to the named UNIX socket. Use open(O_CREAT) to create the file, bind() to try to get exclusive access to it, and listen() to begin accepting connections. This behaviour should not be optional. This behaviour is how it should have been done all along. Just trying to be helpful... :-) mark -- [EMAIL PROTECTED]/[EMAIL PROTECTED]/[EMAIL PROTECTED] __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/ ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ Clamav-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/clamav-users