[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

using win32-service

ahappydeath

10/2/2008 4:36:00 PM

I am trying to create a windows service with Ruby. I have successfully
created the service ( I can open up the services and see the service I
created ) but when I try to start it I get the error message:
"Could not start A Ruby Service(the name I
gave it) on Local Computer.
Error 1053: The service did not respond
to the start or control request in a timely fashion"

I have the executable of the service pointed to the full path of "ruby
c:\service.rb" and the contents of service.rb are:

require 'win32/daemon'
include Win32

class Daemon

def service_main()
while running?
sleep 3
File.open("c:\\test.log", "a") { |f| f.puts "service is running"}
end
end

def service_stop
exit!
end

end

Daemon.mainloop


any ideas what I'm doing wrong?!!!

3 Answers

ahappydeath

10/2/2008 5:19:00 PM

0

On Oct 2, 12:35 pm, ahappydeath <silbe...@gmail.com> wrote:
> I am trying to create a windows service with Ruby. I have successfully
> created the service ( I can open up the services and see the service I
> created ) but when I try to start it I get the error message:
>                             "Could not start A Ruby Service(the name I
> gave it) on Local Computer.
>                               Error 1053: The service did not respond
> to the start or control request in a timely fashion"
>
> I have the executable of the service pointed to the full path of "ruby
> c:\service.rb"  and the contents of service.rb are:
>
> require 'win32/daemon'
> include Win32
>
> class Daemon
>
>   def service_main()
>                 while running?
>                         sleep 3
>                         File.open("c:\\test.log", "a") { |f| f.puts "service is running"}
>                 end
>   end
>
> def service_stop
>      exit!
>  end
>
> end
>
> Daemon.mainloop
>
> any ideas what I'm doing wrong?!!!

also maybe i should mention... I just installed SP3

James Dinkel

10/2/2008 11:26:00 PM

0

ahappydeath wrote:
> On Oct 2, 12:35�pm, ahappydeath <silbe...@gmail.com> wrote:
>
> also maybe i should mention... I just installed SP3

Did it work before you installed SP3?
--
Posted via http://www.ruby-....

ahappydeath

10/3/2008 2:10:00 PM

0

On Oct 2, 7:25 pm, James Dinkel <jdin...@gmail.com> wrote:
> ahappydeath wrote:
> > On Oct 2, 12:35 pm, ahappydeath <silbe...@gmail.com> wrote:
>
> > also maybe i should mention... I just installed SP3
>
> Did it work before you installed SP3?
> --
> Posted viahttp://www.ruby-....

I should have been more clear... I never tried it on SP2.