[Win32utils-devel] Stopping services

Nathaniel Talbott ntalbott at gmail.com
Thu Sep 8 13:53:36 EDT 2005


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.

I wanted to back up and see if the examples worked OK for me, so I ran
daemon_test:

  C:\build\ruby\extensions\win32-service-0.4.6\examples>ruby
daemon_test.rb install
  VERSION: 0.4.6
  installed

  C:\build\ruby\extensions\win32-service-0.4.6\examples>ruby
daemon_test.rb start
  VERSION: 0.4.6
  Ok, started

  C:\build\ruby\extensions\win32-service-0.4.6\examples>ruby daemon_test.rb stop
  VERSION: 0.4.6
  daemon_test.rb:59:in `stop': The pipe has been ended. (Win32::ServiceError)
          from daemon_test.rb:59

Note that you need to wait to attempt the stop until after the service
has started writing "service is running" to C:\test.log before it will
fail.

Any ideas on either of these problems, and/or ways to debug better?
I'm running ruby1.8.3p1 compiled locally with MSVC (7, I think), with
win32-service-0.4.6 on XP Pro SP2.

Thanks,


-- 
Nathaniel Talbott

<:((><



More information about the win32utils-devel mailing list