win32 service error

J

Junkone

Hello
I am trying out an example from http://rubyforge.org/docman/view.php/85/595/service.html
and it errors out
require "win32/service"
include Win32

# Create a new service
Service.create('some_service', nil,
:service_type => Service::WIN32_OWN_PROCESS,
:description => 'A custom service I wrote just for fun'
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => 'E:\TradingTools\torontotrader
\startServer.bat',
:load_order_group => nil,
:dependencies => nil
:service_start_name => 'LocalSystem',
:password => nil,
:display_name => 'This is some service'
)

E:/TradingTools/Development/app/helpers/Ruby-1.rb:8: syntax error,
unexpected tSYMBEG, expecting ')'
:start_type => Service::AUTO_START,
^
 
S

Sebastian Hungerecker

Junkone said:
=A0 =A0 =A0 :description =A0 =A0 =A0 =A0=3D> 'A custom service I wrote ju= st for fun'
=A0 =A0 =A0 :start_type =A0 =A0 =A0 =A0 =3D> Service::AUTO_START,

There's a comma missing after "fun'".

HTH,
Sebastian
=2D-=20
NP: Explosions in the Sky - Remember Me As A Time Of Day
Jabber: (e-mail address removed)
ICQ: 205544826
 
J

Junkone

There's a comma missing after "fun'".

HTH,
Sebastian

thanks for pointing it out.
i get new errors now.
Is there anything that my executable should do in order to be a
service. i have created services before with vb and have not
experienced issues. bat file is a simple one having this statemetn.
thin start -e production -p 3000

When i run it directly, it works. but i run it as part of the
servicem, the start up fails with this error


This is some service service failed to start due to the following
error:
The service did not respond to the start or control request in a
timely fashion.


My code for the service implementation is

require "win32/service"
include Win32

# Create a new service
Service.create('some_service', nil,
:service_type => Service::WIN32_OWN_PROCESS,
:description => 'A custom service I wrote just for fun',
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => 'E:\TradingTools\torontotrader
\startServer.bat',
:load_order_group => nil,
:dependencies => nil,
:service_start_name => 'LocalSystem',
:password => nil,
:display_name => 'This is some service'
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top