[Win32utils-devel] Stopping services

Nathaniel Talbott ntalbott at gmail.com
Fri Sep 9 08:20:26 EDT 2005


On 9/8/05, Berger, Daniel <Daniel.Berger at qwest.com> wrote:

> Hi Nathaniel,
> 
> > I'm back to getting stuff to run as a Windows service, and am
> > running in to a problem. My service (a Daemon ruby class)
> > installs and starts fine, but when I try to stop it, I get:
> >
> >   C:\workspaces\default\tahoe>ruby script\service stop
> >   script/service:77:in `stop': An exception occurred in the
> > service when handling
> >   the control request. (Win32::ServiceError)
> >           from script/service:77
> >           from script/service:76:in `call'
> >           from script/service:88
> >
> > Note that I only get this if the service has successfully
> > made it in to service_main - if I stop it before that, it stops OK.
> 
> Yes, I had that issue a while back.  See
> http://rubyforge.org/pipermail/win32utils-devel/2004-August/000144.html.
> 
> It was never resolved, but it seemed to be harmless.  Yes, it raised an
> error, but the service does stop.  Not ideal, but liveable.

While it does work OK, I'm hesitant to release something that may be
managed by other people and tell them, "Oh, the service manager just
hangs when you stop it, don't worry, it really stopped OK." I can
hear, "What kind of hacky software is this???" from here :-/.


> My *guess* is that it has something to do with the fact that
> win32-service spawns a native thread (in the service_mainloop function)
> which is, afaik, required.  But, that's a guess.  If I'm right, I don't
> know that it's a solveable issue until Ruby 2.0.

Really? Even with your wiz-bang mad C hackery skillz? :-)


> If I'm wrong, then I'm not sure what the issue is.  Any ideas Heesob?

Any other ideas would be greatly appreciated.

Thanks,


-- 
Nathaniel Talbott

<:((><



More information about the win32utils-devel mailing list