You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Jerry M <te...@malcolms.com> on 2010/08/17 22:22:54 UTC

Re: Installing spamd as a Windows service

Ted,

I used SC.exe and it installed spamd successfully as a service (at least 
that's what sc told me).  But when I try to start it, I get "Error 1053 
The service did not respond to the start or control request in a timely 
fashion".  The microsoft help on that message is completely useless.

I tried it several times.  I know it's finding spamd.exe.  In one of my 
tests, I left off the path, and got a completely different error.

Are some of the sc optional parameters that are required for spamd to 
successfully install?  Is there something else I need to be doing?

I'm really surprised that there is so little info or support for 
installing spamd a service.  I run apache http, tomcat, and james, and 
they all simply install as a service automatically or just give me a 
command to run to do it.  If that's still on the SA todo list, then I 
understand.  I've just spent way more time on this than I wanted to.  
But I can't deploy it into production until I can get this thing to run 
as a service.

Thanks.

Jerry


Re: Installing spamd as a Windows service

Posted by Martin Gregorie <ma...@gregorie.org>.
On Tue, 2010-08-17 at 15:22 -0500, Jerry M wrote:
> Error 1053

I tried an internet search for 'Error 1053' and found quite a lot on the
net about it: 
- Some hits are flogging registry cleaners
- others are saying there are problems with an MS dll or .NET. 
- MS says it can be the result of a service taking more than 30 secs to
  start and/or a misconfigured service.
- I also found the manual page for sc.exe and MS instructions for
  setting up services

Only you can know what applies to your particular Windows installation,
so have at it.

  
Martin



Re: Installing spamd as a Windows service

Posted by Ted Mittelstaedt <te...@ipinc.net>.

On 8/17/2010 3:31 PM, René Berber wrote:
> Ted Mittelstaedt wrote:
>
>> Rene, the instsrv.exe and srvany.exe programs were written by
>> Microsoft to allow non-service, command-line daemon programs to
>> be run as services.  The sc.exe program replaced instsrv.exe
>> for newer Windows versions.
>
> I know what they are, and what they do.
>
> You are wrong saying they are for "daemon programs", at least that is
> not precise enough.
>
> Yes they are for command-line programs.  Yes they are for daemon
> programs that can run in the foreground; but not daemons in general.

If your going to get picky then you should not be using the
daemon terminology when referring to Windows programs.  Bill Gates
has such a fear of Windows that he banned as much UNIX terminology
as he could.  daemon was on the list of banned words.  They call
them "services" because Bill liked "servicing" the customers.  Bend
over, Bill wants to "service" you with Windows. ;-)

Ted

Re: Installing spamd as a Windows service

Posted by René Berber <r....@computer.org>.
Ted Mittelstaedt wrote:

> Rene, the instsrv.exe and srvany.exe programs were written by
> Microsoft to allow non-service, command-line daemon programs to
> be run as services.  The sc.exe program replaced instsrv.exe
> for newer Windows versions.

I know what they are, and what they do.

You are wrong saying they are for "daemon programs", at least that is
not precise enough.

Yes they are for command-line programs.  Yes they are for daemon
programs that can run in the foreground; but not daemons in general.
-- 
René Berber


Re: Installing spamd as a Windows service

Posted by Ted Mittelstaedt <te...@ipinc.net>.

On 8/17/2010 2:23 PM, René Berber wrote:
> Jerry M wrote:
>
>> Ted,
>>
>> I used SC.exe and it installed spamd successfully as a service (at least
>> that's what sc told me).  But when I try to start it, I get "Error 1053
>> The service did not respond to the start or control request in a timely
>> fashion".  The microsoft help on that message is completely useless.
>
> smapd is NOT a Windows service, you can't install it just like that.
>

Rene, the instsrv.exe and srvany.exe programs were written by
Microsoft to allow non-service, command-line daemon programs to
be run as services.  The sc.exe program replaced instsrv.exe
for newer Windows versions.

srvany.exe is a wrapper that responds to service commands and
runs the command-line program just like the user runs it at the
command line.  Microsoft distributed it through the ResKit because
it is a limited program, for example it does not handle GUI output from 
the program, etc. and Microsoft didn't want to support it with 100% of
the programs out there.  Generally the stuff MS distributes through
the ResKit are programs that work "most of the time" and perform
some wildly useful task in a specific circumstance.

So yes, you CAN install programs as services "just like that" and
a lot of people have done it with many different programs that are
not services.

I believe with 64-bit windows one other caveat with srvany is if
the thing you are trying to start with srvany.exe is in the real 64 bit
windows\system32 folder, you need to type that in as windows\Sysnative
(Vista only) or to move it somewhere else (XP/2003).

I'm NOT guaranteeing spamd is going to run on all Windows systems
with srvany.  I am just answering the original posters request on
the "by the book" way of running a program as a service.

If sc and srvany.exe don't work then you can use

http://www.coretechnologies.com/products/AlwaysUp/srvany.html

or

http://iain.cx/src/nssm/

Both are commercial and cost money but handle a much larger variety
of software than sc & srvany

> Have you seen Daniel Lemke's announcement on this list?
> http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839
>
> Perhaps the HOWTO referred on that article (I haven't read it) is of
> some help.

The OP may be running that version of spamd already, he didn't say.

Ted

Re: Installing spamd as a Windows service

Posted by Emin Akbulut <em...@gmail.com>.
I use srvman, it's easy to use, it has a gui, and it's free.
I just run C:\NET\SpamAssassinWin32-EX\spamd-service.bat
as Win32 service, as LocalSystem account.

spamd-service.bat is below:

taskkill /F /IM:spamd.exe
C:
CD C:\NET\SpamAssassinWin32-EX
@rem spamd.exe --max-spare=6
spamd.exe -D --syslog="spamd.log" --max-spare=6


I hope it helps.



On Wed, Aug 18, 2010 at 12:23 AM, René Berber <r....@computer.org> wrote:

> Jerry M wrote:
>
> > Ted,
> >
> > I used SC.exe and it installed spamd successfully as a service (at least
> > that's what sc told me).  But when I try to start it, I get "Error 1053
> > The service did not respond to the start or control request in a timely
> > fashion".  The microsoft help on that message is completely useless.
>
> smapd is NOT a Windows service, you can't install it just like that.
>
> Have you seen Daniel Lemke's announcement on this list?
> http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839
>
> Perhaps the HOWTO referred on that article (I haven't read it) is of
> some help.
> --
> René Berber
>
>

Re: Installing spamd as a Windows service

Posted by Ted Mittelstaedt <te...@ipinc.net>.

On 8/17/2010 3:27 PM, Jerry M wrote:
> I'm running Windows server 2008, 32-bit.  All the latest fixpacks are
> installed.
>
> I used SC exactly like it said:
>
> SC create spamd binPath=c:\spamassassin\spamd.exe
>

That isn't going to work since spamd does not have code in it to
respond to service commands.  I already posted a link to the way
way you should try it but I'll spell it out here:

1) Copy srvany.exe from the Windows Server 2003 Resource Kit to
\Program Files\oldResourceKitTools.

2) issue the sc command:

sc create spamd start= auto binPath= "C:\Program 
Files\oldResourceKitTools\srvany.exe" DisplayName= "Spamd" obj= 
DOMAIN\User password= password

DOMAIN\User being replaced by the MS domain name your using
and the userID you want to run it under (spamd)

3)run regedit32 and look for HLM\System\currentcontrolset\services\spamd
and

 From the Edit menu, click Add Key. Type the following and click OK:
Key Name: Parameters
Class :<leave blank>

Select the Parameters key.

 From the Edit menu, click Add Value. Type the following and click OK:
Value Name: Application
Data Type : REG_SZ
String : <path>\<application.ext>

where
.ext><path>\<application.ext>

  is the drive and full path to the application executable including the 
extension (i.e., C:\WinNT\Notepad.exe).ext>.ext>

Close Registry Editor.

4) Open \Management\Services\Spamd. Go to the second register(Login) and 
change the "Login as" from the local system account to another account 
(use the "Spamd" account, make sure the user "Spamd" is a member of the 
Domain Guests group only

> It came back and said service installed successfully. I bring up the
> services window, and it is listed as expected. I selected it and tried
> to start it, and got an immediate error.
>

Correct, it's not a service, that is why you use svrany.exe

Some command-line "daemon" Windows programs have code in them to
respond to service commands, so they will work with the direct "sc"
method.  Microsoft wants to get people to recompile their windows
software with the hooks in it to do this, which is why they don't
spell it out for you.  They don't want to piss-off developers so
they aren't being honest and just saying outright "your code is
shit, recompile" so instead they put out a lot of info so users like
yourself get caught and start bitching at the software developers.

> I had already seen the Lemke article. I actually installed the JAM
> version of SpamAssassin. They make a point about include spamd. But as
> usual, give no information on how to use it in a production server
> environment. I sent them a question as well.
>
> Are you saying that no one has EVER run spamd as a windows service, and
> it is impossible to do so short of buying some 3rd party software?? I
> assume that if no one has ever installed it as a service, no one is
> using spamassassin in server mode (i.e. from JAMES) on windows. That is
> pretty amazing considering the popularity of both james and spamassassin.
>
> If there are indeed users of both on Windows, and if running as a
> service without additional expense is not possible, how are they doing it?
>
> I just want to know how everyone else is doing this on windows with the
> JAMES mail server, unless I'm the very first person to try it (???)
>

I find this line of reasoning rather silly.  You have paid close to
a thousand bucks for that Microsoft Server 2008 software license and all
of it's CALs and your balking at a miserable $20 to a 3rd party software
developer to allow you to run a free piece of software?!?!

MS wrote srvany for people like you to use.  Instructions for using
it have to be pieced together out of a dozen bits here and there
precisely because Microsoft doesn't want people like you who don't
want to spend the time piecing together the bits and pieces to be
bothering them on the phone.  Forcing you to do this piecing raises the 
bar significantly so that people too incompetent to do the piecing give 
up and buy a commercial replica of srvany which gives them a 3rd party 
to RTFM to them.

I am not saying your incompetent.  I AM saying that you really don't 
understand much of how Microsoft markets their software.  Your ranting 
to us precisely because Microsoft gives you a half-assed tool to use
that doesn't always work right, because Microsoft tries to position
Windows as both a dumb-user solution and an advanced user solution.  The
dumb users bitch and when nobody helps them they pay $$ to a commercial
developer.  The advanced users know MS is screwing them over but they
also know how to beat on the system until it kind of works, sorta.  By
starting in with the rhetorical questions and statements your getting 
very close to the line between advanced user and dumb user.

As I said before, svrany is a wrapper.  You run the wrapper as a service
and the wrapper runs spamd.  Thus, spamd is run as a service.  Pretty
basic structural theory, there.  The rest is figuring out syntax.

Ted

>
> On 8/17/2010 4:54 PM, Ted Mittelstaedt wrote:
>>
>>
>> On 8/17/2010 2:23 PM, René Berber wrote:
>>> Jerry M wrote:
>>>
>>>> Ted,
>>>>
>>>> I used SC.exe and it installed spamd successfully as a service (at
>>>> least
>>>> that's what sc told me). But when I try to start it, I get "Error 1053
>>>> The service did not respond to the start or control request in a timely
>>>> fashion". The microsoft help on that message is completely useless.
>>>
>>> smapd is NOT a Windows service, you can't install it just like that.
>>>
>>
>> Rene, the instsrv.exe and srvany.exe programs were written by
>> Microsoft to allow non-service, command-line daemon programs to
>> be run as services. The sc.exe program replaced instsrv.exe
>> for newer Windows versions.
>>
>> srvany.exe is a wrapper that responds to service commands and
>> runs the command-line program just like the user runs it at the
>> command line. Microsoft distributed it through the ResKit because
>> it is a limited program, for example it does not handle GUI output
>> from the program, etc. and Microsoft didn't want to support it with
>> 100% of
>> the programs out there. Generally the stuff MS distributes through
>> the ResKit are programs that work "most of the time" and perform
>> some wildly useful task in a specific circumstance.
>>
>> So yes, you CAN install programs as services "just like that" and
>> a lot of people have done it with many different programs that are
>> not services.
>>
>> I believe with 64-bit windows one other caveat with srvany is if
>> the thing you are trying to start with srvany.exe is in the real 64 bit
>> windows\system32 folder, you need to type that in as windows\Sysnative
>> (Vista only) or to move it somewhere else (XP/2003).
>>
>> I'm NOT guaranteeing spamd is going to run on all Windows systems
>> with srvany. I am just answering the original posters request on
>> the "by the book" way of running a program as a service.
>>
>> If sc and srvany.exe don't work then you can use
>>
>> http://www.coretechnologies.com/products/AlwaysUp/srvany.html
>>
>> or
>>
>> http://iain.cx/src/nssm/
>>
>> Both are commercial and cost money but handle a much larger variety
>> of software than sc & srvany
>>
>>> Have you seen Daniel Lemke's announcement on this list?
>>> http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839
>>>
>>> Perhaps the HOWTO referred on that article (I haven't read it) is of
>>> some help.
>>
>> The OP may be running that version of spamd already, he didn't say.
>>
>> Ted
>>
>

Re: Installing spamd as a Windows service

Posted by Martin Gregorie <ma...@gregorie.org>.
On Tue, 2010-08-17 at 17:27 -0500, Jerry M wrote:
> I'm running Windows server 2008, 32-bit.  All the latest fixpacks are 
> installed.
> 
> I used SC exactly like it said:
> 
> SC create spamd binPath=c:\spamassassin\spamd.exe
> 
> It came back and said service installed successfully.  I bring up the 
> services window, and it is listed as expected.  I selected it and tried 
> to start it, and got an immediate error.
> 
Does that environment let you set the debug options? If not, can you run
spamd in a wrapper that would let you set them? Seeing the output from
the -D --lint options could be helpful.
 
Are you using a relative path to the directory holding the configuration
files? If so, is the service running spamd in the current working
directory you think its using or would you be better off using absolute
pathnames?


Martin



Re: Installing spamd as a Windows service

Posted by Emin Akbulut <em...@gmail.com>.
Wow, the messages look like rocket science : )

Jerry, I'm happy that it helped. I think JAM version of
spamd (3.3.1) cannot work if you don't change the working directory,
so I invented that .bat file. I mean if you set the line
   spamd.exe -D --syslog="spamd.log" --max-spare=6
in srvman, the service won't start because of error.

Bear in mind you have to kill spamd.exe when you need to stop
the service. restart-spamassassin.bat may look like this:

   NET STOP Spamassassin
   TASKKILL /F /IM:spamd.exe
   NET START Spamassassin

-if you named the service as Spamassasin-


In Windows port, spamd becomes non-responsive regularly.
You have to monitor that service. In my Windows box,
revocer log is below & gives you an idea about stability of spamd


30.07.2010, 20:55:13, RESTARTED
31.07.2010, 21:15:13, RESTARTED
01.08.2010, 21:15:13, RESTARTED
02.08.2010, 22:35:16, RESTARTED
03.08.2010, 22:10:14, RESTARTED
05.08.2010,  0:15:11, RESTARTED
05.08.2010, 13:05:51, RESTARTED
05.08.2010, 16:35:13, RESTARTED
06.08.2010, 14:30:13, RESTARTED
07.08.2010, 14:15:13, RESTARTED
08.08.2010, 13:55:14, RESTARTED
09.08.2010, 14:00:13, RESTARTED
09.08.2010, 14:55:13, RESTARTED
10.08.2010, 14:50:15, RESTARTED
11.08.2010, 14:25:15, RESTARTED
12.08.2010, 14:50:14, RESTARTED
14.08.2010, 19:35:13, RESTARTED
15.08.2010, 19:35:13, RESTARTED
16.08.2010, 20:10:13, RESTARTED
17.08.2010, 19:55:12, RESTARTED


If you need the monitoring script I'll post, too.



On Wed, Aug 18, 2010 at 3:22 AM, Ted Mittelstaedt <te...@ipinc.net> wrote:

> srvman and srvany are both wrappers, they do the same thing.  The
> only difference is in who wrote them.  There are a lot of small tools
> like that floating around.  Just be aware that sometimes the
> security updates will break them.  I'd still like to find an update
> for Virtual CD-ROM Control Panel for Windows XP.  Microsoft busted that
> one about 3-4 months ago with a security update and the others that
> are out there are big and piggy.
>
> Ted
>
>

Re: Installing spamd as a Windows service

Posted by Emin Akbulut <em...@gmail.com>.
Simply schedule a batch file in 5 min. intervals
-Windows Server 2008 minimum interval is 5 minute-
It's not high cpu or memory consuming process.
You also need freeware *cryping* utility.
I use MailEnable as MTA, you may ignore it.
Script produces 2 files: check.log & error.log
I also test SA score on exit to make sure things are ok.

This script checks spamd is alive or not and restarts if necessary.


*check-spamassassin.bat*



c:
cd \NET\Services


@echo %Date%, %time:~0,8% >> check-spamassassin.log

@REM Test Spamassassin service
cryping -port 783 127.0.0.1 | Find "100%%" > nul
@If ErrorLevel 1 Goto OK

:RESTART
@echo Restarting Spamassassin & MTA services...

NET STOP MEMTAS
NET STOP Spamassassin
TASKKILL /F /IM:spamd.exe
NET START Spamassassin
NET START MEMTAS

@echo Done!
@echo RESTARTED >> check-spamassassin.log
@echo %Date%, %time:~0,8%, RESTARTED >> error-spamassassin.log
@GoTo EXIT

:OK
@echo Everything seems OK!
@echo OK >> check-spamassassin.log
@GoTo EXIT

:EXIT
@REM Test spam score
C:\NET\SpamAssassinWin32-EX\winspamc.exe <
C:\NET\SpamAssassinWin32-EX\realspam3.txt  | Find "X-Spam-Status:"  >>
check-spamassassin.log
@REM Add a blank line
@echo    >> check-spamassassin.log
@rem pause > nul




On Wed, Aug 18, 2010 at 4:45 PM, Jerry M <te...@malcolms.com> wrote:

>  Thank you so much for the info.  Yes.  the monitoring script would be
> great as well.
>
> Thanks.again.
>
> Jerry
>

Re: Installing spamd as a Windows service

Posted by Ted Mittelstaedt <te...@ipinc.net>.
srvman and srvany are both wrappers, they do the same thing.  The
only difference is in who wrote them.  There are a lot of small tools
like that floating around.  Just be aware that sometimes the
security updates will break them.  I'd still like to find an update
for Virtual CD-ROM Control Panel for Windows XP.  Microsoft busted that
one about 3-4 months ago with a security update and the others that
are out there are big and piggy.

Ted


On 8/17/2010 4:46 PM, Jerry M wrote:
>    Thanks for the info.  But Emin's bat file and srvman was all it took to get it
> installed and running.
>
> On 8/17/2010 6:07 PM, Ted Mittelstaedt wrote:
>>
>>
>>  On 8/17/2010 3:27 PM, Jerry M wrote:
>>>  I'm running Windows server 2008, 32-bit. All the latest fixpacks are
>>>  installed.
>>>
>>>  I used SC exactly like it said:
>>>
>>>  SC create spamd binPath=c:\spamassassin\spamd.exe
>>>
>>
>>  That isn't going to work since spamd does not have code in it to
>>  respond to service commands. I already posted a link to the way
>>  way you should try it but I'll spell it out here:
>>
>>  1) Copy srvany.exe from the Windows Server 2003 Resource Kit to
>>  \Program Files\oldResourceKitTools.
>>
>>  2) issue the sc command:
>>
>>  sc create spamd start= auto binPath= "C:\Program
>>  Files\oldResourceKitTools\srvany.exe" DisplayName= "Spamd" obj= DOMAIN\User
>>  password= password
>>
>>  DOMAIN\User being replaced by the MS domain name your using
>>  and the userID you want to run it under (spamd)
>>
>>  3)run regedit32 and look for HLM\System\currentcontrolset\services\spamd
>>  and
>>
>>   From the Edit menu, click Add Key. Type the following and click OK:
>>  Key Name: Parameters
>>  Class :<leave blank>
>>
>>  Select the Parameters key.
>>
>>   From the Edit menu, click Add Value. Type the following and click OK:
>>  Value Name: Application
>>  Data Type : REG_SZ
>>  String :<path>\<application.ext>
>>
>>  where
>>  .ext><path>\<application.ext>
>>
>>  is the drive and full path to the application executable including the
>>  extension (i.e., C:\WinNT\Notepad.exe).ext>.ext>
>>
>>  Close Registry Editor.
>>
>>  4) Open \Management\Services\Spamd. Go to the second register(Login) and
>>  change the "Login as" from the local system account to another account (use
>>  the "Spamd" account, make sure the user "Spamd" is a member of the Domain
>>  Guests group only
>>
>>>  It came back and said service installed successfully. I bring up the
>>>  services window, and it is listed as expected. I selected it and tried
>>>  to start it, and got an immediate error.
>>>
>>
>>  Correct, it's not a service, that is why you use svrany.exe
>>
>>  Some command-line "daemon" Windows programs have code in them to
>>  respond to service commands, so they will work with the direct "sc"
>>  method. Microsoft wants to get people to recompile their windows
>>  software with the hooks in it to do this, which is why they don't
>>  spell it out for you. They don't want to piss-off developers so
>>  they aren't being honest and just saying outright "your code is
>>  shit, recompile" so instead they put out a lot of info so users like
>>  yourself get caught and start bitching at the software developers.
>>
>>>  I had already seen the Lemke article. I actually installed the JAM
>>>  version of SpamAssassin. They make a point about include spamd. But as
>>>  usual, give no information on how to use it in a production server
>>>  environment. I sent them a question as well.
>>>
>>>  Are you saying that no one has EVER run spamd as a windows service, and
>>>  it is impossible to do so short of buying some 3rd party software?? I
>>>  assume that if no one has ever installed it as a service, no one is
>>>  using spamassassin in server mode (i.e. from JAMES) on windows. That is
>>>  pretty amazing considering the popularity of both james and spamassassin.
>>>
>>>  If there are indeed users of both on Windows, and if running as a
>>>  service without additional expense is not possible, how are they doing it?
>>>
>>>  I just want to know how everyone else is doing this on windows with the
>>>  JAMES mail server, unless I'm the very first person to try it (???)
>>>
>>
>>  I find this line of reasoning rather silly. You have paid close to
>>  a thousand bucks for that Microsoft Server 2008 software license and all
>>  of it's CALs and your balking at a miserable $20 to a 3rd party software
>>  developer to allow you to run a free piece of software?!?!
>>
>>  MS wrote srvany for people like you to use. Instructions for using
>>  it have to be pieced together out of a dozen bits here and there
>>  precisely because Microsoft doesn't want people like you who don't
>>  want to spend the time piecing together the bits and pieces to be
>>  bothering them on the phone. Forcing you to do this piecing raises the bar
>>  significantly so that people too incompetent to do the piecing give up and buy
>>  a commercial replica of srvany which gives them a 3rd party to RTFM to them.
>>
>>  I am not saying your incompetent. I AM saying that you really don't understand
>>  much of how Microsoft markets their software. Your ranting to us precisely
>>  because Microsoft gives you a half-assed tool to use
>>  that doesn't always work right, because Microsoft tries to position
>>  Windows as both a dumb-user solution and an advanced user solution. The
>>  dumb users bitch and when nobody helps them they pay $$ to a commercial
>>  developer. The advanced users know MS is screwing them over but they
>>  also know how to beat on the system until it kind of works, sorta. By
>>  starting in with the rhetorical questions and statements your getting very
>>  close to the line between advanced user and dumb user.
>>
>>  As I said before, svrany is a wrapper. You run the wrapper as a service
>>  and the wrapper runs spamd. Thus, spamd is run as a service. Pretty
>>  basic structural theory, there. The rest is figuring out syntax.
>>
>>  Ted
>>
>>>
>>>  On 8/17/2010 4:54 PM, Ted Mittelstaedt wrote:
>>>>
>>>>
>>>>  On 8/17/2010 2:23 PM, René Berber wrote:
>>>>>  Jerry M wrote:
>>>>>
>>>>>>  Ted,
>>>>>>
>>>>>>  I used SC.exe and it installed spamd successfully as a service (at
>>>>>>  least
>>>>>>  that's what sc told me). But when I try to start it, I get "Error 1053
>>>>>>  The service did not respond to the start or control request in a timely
>>>>>>  fashion". The microsoft help on that message is completely useless.
>>>>>
>>>>>  smapd is NOT a Windows service, you can't install it just like that.
>>>>>
>>>>
>>>>  Rene, the instsrv.exe and srvany.exe programs were written by
>>>>  Microsoft to allow non-service, command-line daemon programs to
>>>>  be run as services. The sc.exe program replaced instsrv.exe
>>>>  for newer Windows versions.
>>>>
>>>>  srvany.exe is a wrapper that responds to service commands and
>>>>  runs the command-line program just like the user runs it at the
>>>>  command line. Microsoft distributed it through the ResKit because
>>>>  it is a limited program, for example it does not handle GUI output
>>>>  from the program, etc. and Microsoft didn't want to support it with
>>>>  100% of
>>>>  the programs out there. Generally the stuff MS distributes through
>>>>  the ResKit are programs that work "most of the time" and perform
>>>>  some wildly useful task in a specific circumstance.
>>>>
>>>>  So yes, you CAN install programs as services "just like that" and
>>>>  a lot of people have done it with many different programs that are
>>>>  not services.
>>>>
>>>>  I believe with 64-bit windows one other caveat with srvany is if
>>>>  the thing you are trying to start with srvany.exe is in the real 64 bit
>>>>  windows\system32 folder, you need to type that in as windows\Sysnative
>>>>  (Vista only) or to move it somewhere else (XP/2003).
>>>>
>>>>  I'm NOT guaranteeing spamd is going to run on all Windows systems
>>>>  with srvany. I am just answering the original posters request on
>>>>  the "by the book" way of running a program as a service.
>>>>
>>>>  If sc and srvany.exe don't work then you can use
>>>>
>>>>  http://www.coretechnologies.com/products/AlwaysUp/srvany.html
>>>>
>>>>  or
>>>>
>>>>  http://iain.cx/src/nssm/
>>>>
>>>>  Both are commercial and cost money but handle a much larger variety
>>>>  of software than sc&  srvany
>>>>
>>>>>  Have you seen Daniel Lemke's announcement on this list?
>>>>>  http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839
>>>>>
>>>>>  Perhaps the HOWTO referred on that article (I haven't read it) is of
>>>>>  some help.
>>>>
>>>>  The OP may be running that version of spamd already, he didn't say.
>>>>
>>>>  Ted
>>>>
>>>
>>

Re: Installing spamd as a Windows service

Posted by Jerry M <te...@malcolms.com>.
  I'm running Windows server 2008, 32-bit.  All the latest fixpacks are 
installed.

I used SC exactly like it said:

SC create spamd binPath=c:\spamassassin\spamd.exe

It came back and said service installed successfully.  I bring up the 
services window, and it is listed as expected.  I selected it and tried 
to start it, and got an immediate error.

I had already seen the Lemke article.  I actually installed the JAM 
version of SpamAssassin.  They make a point about include spamd.  But as 
usual, give no information on how to use it in a production server 
environment.  I sent them a question as well.

Are you saying that no one has EVER run spamd as a windows service, and 
it is impossible to do so short of buying some 3rd party software??  I 
assume that if no one has ever installed it as a service, no one is 
using spamassassin in server mode (i.e. from JAMES) on windows.  That is 
pretty amazing considering the popularity of both james and spamassassin.

If there are indeed users of both on Windows, and if running as a 
service without additional expense is not possible, how are they doing it?

I just want to know how everyone else is doing this on windows with the 
JAMES mail server, unless I'm the very first person to try it (???)


On 8/17/2010 4:54 PM, Ted Mittelstaedt wrote:
>
>
> On 8/17/2010 2:23 PM, René Berber wrote:
>> Jerry M wrote:
>>
>>> Ted,
>>>
>>> I used SC.exe and it installed spamd successfully as a service (at 
>>> least
>>> that's what sc told me).  But when I try to start it, I get "Error 1053
>>> The service did not respond to the start or control request in a timely
>>> fashion".  The microsoft help on that message is completely useless.
>>
>> smapd is NOT a Windows service, you can't install it just like that.
>>
>
> Rene, the instsrv.exe and srvany.exe programs were written by
> Microsoft to allow non-service, command-line daemon programs to
> be run as services.  The sc.exe program replaced instsrv.exe
> for newer Windows versions.
>
> srvany.exe is a wrapper that responds to service commands and
> runs the command-line program just like the user runs it at the
> command line.  Microsoft distributed it through the ResKit because
> it is a limited program, for example it does not handle GUI output 
> from the program, etc. and Microsoft didn't want to support it with 
> 100% of
> the programs out there.  Generally the stuff MS distributes through
> the ResKit are programs that work "most of the time" and perform
> some wildly useful task in a specific circumstance.
>
> So yes, you CAN install programs as services "just like that" and
> a lot of people have done it with many different programs that are
> not services.
>
> I believe with 64-bit windows one other caveat with srvany is if
> the thing you are trying to start with srvany.exe is in the real 64 bit
> windows\system32 folder, you need to type that in as windows\Sysnative
> (Vista only) or to move it somewhere else (XP/2003).
>
> I'm NOT guaranteeing spamd is going to run on all Windows systems
> with srvany.  I am just answering the original posters request on
> the "by the book" way of running a program as a service.
>
> If sc and srvany.exe don't work then you can use
>
> http://www.coretechnologies.com/products/AlwaysUp/srvany.html
>
> or
>
> http://iain.cx/src/nssm/
>
> Both are commercial and cost money but handle a much larger variety
> of software than sc & srvany
>
>> Have you seen Daniel Lemke's announcement on this list?
>> http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839
>>
>> Perhaps the HOWTO referred on that article (I haven't read it) is of
>> some help.
>
> The OP may be running that version of spamd already, he didn't say.
>
> Ted
>

Re: Installing spamd as a Windows service

Posted by René Berber <r....@computer.org>.
Jerry M wrote:

> Ted,
> 
> I used SC.exe and it installed spamd successfully as a service (at least
> that's what sc told me).  But when I try to start it, I get "Error 1053
> The service did not respond to the start or control request in a timely
> fashion".  The microsoft help on that message is completely useless.

smapd is NOT a Windows service, you can't install it just like that.

Have you seen Daniel Lemke's announcement on this list?
http://article.gmane.org/gmane.mail.spam.spamassassin.general/128839

Perhaps the HOWTO referred on that article (I haven't read it) is of
some help.
-- 
René Berber


Re: Installing spamd as a Windows service

Posted by Daniel Lemke <le...@jam-software.com>.
Just to clarify some things:


Jerry M wrote:
> 
> I'm really surprised that there is so little info or support for
> installing spamd a service. 
> 

The reason, it is not mentioned in the official SpamAssassin docs or Wiki is
because SpamD is not supported for Windows. There are projects like SaWin32
(unfortunately discontinued) and the one I am developing (SpamAssassin for
Windows) but you'll always have to consider that they are some kind of
Windows port and therefore may not behave like a SpamAssassin you installed
on a unix box.


Jerry M wrote:
> 
> I run apache http, tomcat, and james, and they all simply install as a
> service automatically or just give me a command to run to do it.  If
> that's still on the SA todo list, then I understand.  
> 
It is not on the SpamAssassin todo list and it will never be because the
SpamAssassin project "just" provides the sources to compile this great
spamfilter yourself. For most unix users this is not a big deal, however for
Windows you will have to consider some additional issues, most of this is
mentioned in my HowTo on the JAM Software website. However, compiling
SpamAssassin yourself will not provide you with the usual Windows
[exe]cutable files, it will create a batch file that serves as a wrapper for
the actual Perl scripts, SpamAssassin is contained in. As the official
SpamAssassin project does not provide binary builds, you may understand,
that they do not provide Windows setup files either.

JAM provides a binary build of SpamAssassin as we use it in some of our
commercial applications. As we owe something to the developers and the
community, we provide the binary build free of charge and published a HowTo
to create it yourself. However, we will not provide it as a preconfigured,
easy-to-use Windows service, as this would make parts of our products kind
of obsolete.

Just to mention it: I'm looking forward to release a new build of our port
within the next weeks (lost some time finishing my bachelor thesis ;)).
There have been made improvements regarding SpamD stability, also Razor will
now be able to work properly.


Best regards,

Daniel Lemke
-- 
View this message in context: http://old.nabble.com/Re%3A-Installing-spamd-as-a-Windows-service-tp29464763p29468978.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Installing spamd as a Windows service

Posted by Jerry M <te...@malcolms.com>.
   Martin,

None of them apply.  That's why I said the info on the error on the MS 
site was of no use.

I have no registry cleaners.  It doesn't take longer than 30 seconds.  
The error returns instantly.  I doubt seriously that there is a problem 
with an MS dll or .net.  This is a system that is successfully actively 
hosting several domains with Apache HTTP, Tomcat, JAMES, mySQL,and PHP  
There are no problems with any other service.

Jerry

On 8/17/2010 4:50 PM, Martin Gregorie wrote:
> On Tue, 2010-08-17 at 15:22 -0500, Jerry M wrote:
>> Error 1053
> I tried an internet search for 'Error 1053' and found quite a lot on the
> net about it:
> - Some hits are flogging registry cleaners
> - others are saying there are problems with an MS dll or .NET.
> - MS says it can be the result of a service taking more than 30 secs to
>    start and/or a misconfigured service.
> - I also found the manual page for sc.exe and MS instructions for
>    setting up services
>
> Only you can know what applies to your particular Windows installation,
> so have at it.
>
>
> Martin
>
>
>