Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

clamd socket created long after startup

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


james.teh at netboxblue

Jun 3, 2007, 7:55 PM

Post #1 of 3 (1936 views)
Permalink
clamd socket created long after startup

Hi all,

As of version 0.90, clamd daemonizes before it loads the databases,
creates the socket and begins accepting connections. Unfortunately, as
the databases grow, clamd can take quite a while to initialise (I've
seen upwards of 65 seconds on some slower or loaded systems). This
causes problems for programs that rely on clamd being ready to accept
connections. In order to ensure that clamd is fully initialised, it must
be started and then one must continually check for the presence of the
clamd socket file, which is not a particularly efficient or reliable
solution. In 0.8x, this was not an issue because clamd did not daemonise
until after database initialisation. Thus, one could simply wait for
clamd to return (due to forking) and assume it was fully initialised.

The issue is also described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=427154
although a different solution is proposed.

I have patched 0.90.3 to daemonise just before entering the socket
accept loop. I am posting here rather than opening a bug in Bugzilla
because I am uncertain as to whether this is considered a bug. This
behaviour was probably changed for a reason and I am curious as to the
reason. I will file a bug subject to responses from developers.

Thanks for such a wonderful project.

Jamie


Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


rbgarga at gmail

Jun 5, 2007, 5:59 PM

Post #2 of 3 (1865 views)
Permalink
Re: clamd socket created long after startup [In reply to]

On 6/3/07, James Teh <james.teh [at] netboxblue> wrote:
> Hi all,
>
> As of version 0.90, clamd daemonizes before it loads the databases,
> creates the socket and begins accepting connections. Unfortunately, as
> the databases grow, clamd can take quite a while to initialise (I've
> seen upwards of 65 seconds on some slower or loaded systems). This
> causes problems for programs that rely on clamd being ready to accept
> connections. In order to ensure that clamd is fully initialised, it must
> be started and then one must continually check for the presence of the
> clamd socket file, which is not a particularly efficient or reliable
> solution. In 0.8x, this was not an issue because clamd did not daemonise
> until after database initialisation. Thus, one could simply wait for
> clamd to return (due to forking) and assume it was fully initialised.
>
> The issue is also described here:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=427154
> although a different solution is proposed.
>
> I have patched 0.90.3 to daemonise just before entering the socket
> accept loop. I am posting here rather than opening a bug in Bugzilla
> because I am uncertain as to whether this is considered a bug. This
> behaviour was probably changed for a reason and I am curious as to the
> reason. I will file a bug subject to responses from developers.
>
> Thanks for such a wonderful project.

If you are interested, there is a workaround to it on clamav-milter
startup script of FreeBSD ports, you can take a look at:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/clamav/files/clamav-milter.in?rev=1.4;content-type=text%2Fplain

--
Renato Botelho
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


james.teh at netboxblue

Jun 5, 2007, 6:23 PM

Post #3 of 3 (1876 views)
Permalink
Re: clamd socket created long after startup [In reply to]

Renato Botelho wrote:
> On 6/3/07, James Teh <james.teh [at] netboxblue> wrote:
>> As of version 0.90, clamd daemonizes before it loads the databases,
>> creates the socket and begins accepting connections. Unfortunately, as
>> the databases grow, clamd can take quite a while to initialise (I've
>> seen upwards of 65 seconds on some slower or loaded systems). This
>> causes problems for programs that rely on clamd being ready to accept
>> connections. In order to ensure that clamd is fully initialised, it must
>> be started and then one must continually check for the presence of the
>> clamd socket file...
> If you are interested, there is a workaround to it on clamav-milter
> startup script of FreeBSD ports, you can take a look at:
> http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/clamav/files/clamav-milter.in?rev=1.4;content-type=text%2Fplain
I have a similar work around, but 100% reliability is still not
guaranteed, hence the proposed patch. Thanks for the link, though.

Jamie

Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.