[Win32utils-devel] Problems with custom service and webrick

Park Heesob phasis at nownuri.net
Sat May 14 02:36:11 EDT 2005

Hi Dan,
----- Original Message ----- 
From: "Daniel Berger" <djberg96 at yahoo.com>
To: <win32utils-devel at rubyforge.org>
Sent: Saturday, May 14, 2005 2:00 PM
Subject: [Win32utils-devel] Problems with custom service and webrick

> Hi all,
> Windows XP Pro
> Ruby 1.8.2
> I'm having a couple of problems with the following
> service.  The first issue is that the code in
> service_start doesn't seem to fire off.  The second
> problem is that any attempt to do 'require "webrick"'
> within webrick_daemon.rb causes the service to fail on
> start.
> Any ideas?
First, "service_start" is not defined as event handler from the first. :)
If you want service_start, call it in service_main like this:
  def service_main
      while state == RUNNING
         File.open(@log, "a+"){ |fh| fh.puts "Service running" }
         sleep 5

Second, try load webrick befre loading win32/service like this:
require "webrick.rb"
require "win32/service"


Park Heesob

More information about the win32utils-devel mailing list