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


Reply via email to