Mailing List Archive

Windows service
I am trying to set up a Windows service running clamd.exe. At first I was
running into a timeout
issue whereby it would take too long to start, so the service manager would
kill it. So I increased
the value of ServicesPipeTimeout to 60 seconds. That took care of that
problem.

Now I can see in the clamd.log that the process finishes starting up, but
Windows doesn't
recognize it. So once the 60 seconds comes around, it kills the clamd.exe
process. I have tried
both foreground and daemonizing the clamd.exe process, both with the same
result.

Am I missing something?

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Windows service [ In reply to ]
Regarding the foreground option on Windows, clamd.exe remains in the foreground regardless of the setting. This is intentional, because programs in Windows aren't expected to background themselves. It's not normal behavior.

A daemon on Posix systems is just an ordinary program that creates a backgrounded copy of itself. A service on Windows is not an ordinary program. A service implements functions to handle starting, stopping, and restarting of the service. A service written in C or C++ implements ServiceMain instead of main or WinMain. MSDN reference for details: https://docs.microsoft.com/en-us/windows/win32/services/writing-a-servicemain-function Clamd.exe does not implement ServiceMain, and thus can't be run as a service.

You may have some success wrapping clamd.exe in a service. One way to do this would be to implement a service in Powershell that runs clamd.exe. It's been some time since I tried anything like this though, so the specifics are really hazy to me. I tried searching online for instructions on how to do this and came up with this: https://msdn.microsoft.com/en-us/magazine/mt703436.aspx. I'm not sure if that helps any.

Micah


?On 7/5/19, 12:39 PM, "clamav-users on behalf of lists--- via clamav-users" <clamav-users-bounces@lists.clamav.net on behalf of clamav-users@lists.clamav.net> wrote:

I am trying to set up a Windows service running clamd.exe. At first I was
running into a timeout
issue whereby it would take too long to start, so the service manager would
kill it. So I increased
the value of ServicesPipeTimeout to 60 seconds. That took care of that
problem.

Now I can see in the clamd.log that the process finishes starting up, but
Windows doesn't
recognize it. So once the 60 seconds comes around, it kills the clamd.exe
process. I have tried
both foreground and daemonizing the clamd.exe process, both with the same
result.

Am I missing something?

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml



_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Windows service [ In reply to ]
This problem sounds very familiar...though on Linux....

Clamd can take VERY long to load it's signatures,
Try increasing your ServicesPipeTimeout to exagerated 600 sec to see if
it fully loads.
If that works you may want to lower values till you feel comfortable
with the length.

On 7/5/19 6:39 PM, lists--- via clamav-users wrote:
> I am trying to set up a Windows service running clamd.exe. At first I
> was running into a timeout issue whereby it would take too long to
> start, so the service manager would kill it. So I increased
> the value of ServicesPipeTimeout to 60 seconds. That took care of that
> problem.
>
> Now I can see in the clamd.log that the process finishes starting up,
> but Windows doesn't
> recognize it. So once the 60 seconds comes around, it kills the
> clamd.exe process. I have tried
> both foreground and daemonizing the clamd.exe process, both with the
> same result.
>
> Am I missing something?
>
> _______________________________________________
>
> clamav-users mailing list
> clamav-users@lists.clamav.net
> https://lists.clamav.net/mailman/listinfo/clamav-users
>
>
> Help us build a comprehensive ClamAV guide:
> https://github.com/vrtadmin/clamav-faq
>
> http://www.clamav.net/contact.html#ml


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml