A
Ashish Deepak4
Hi Guys,
I desperately need help with this as I can't understand why it is
working.
I am trying to create windows service using win32/service with a
specific user login. I have provided the username and password correctly
in my ruby script.
Essentially, when i run the script below it successfully creates the
service. But fails to start saying "Logon Failure" message. However,
if I go to the windows service window (services.msc) and right click
service and then go to properties->Log On and enter the same password
and then start the service it all works fine.
Please help if you have ever encounter this before? I do not understand
what is going on. (I am logged in as Adminstrator when I run this
script)
myService.ruby
------------------------------------------------------------------------
require "win32/service"
include Win32
Service.create("MyService", nil,
:description => "My Ruby Service",
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => "C:\myService.exe",
:display_name => "MyService",
:service_start_name => "domain\\myUser",
assword => "myPass",
:service_type=> Service::SERVICE_WIN32_OWN_PROCESS
)
Service.start("MyService")
I desperately need help with this as I can't understand why it is
working.
I am trying to create windows service using win32/service with a
specific user login. I have provided the username and password correctly
in my ruby script.
Essentially, when i run the script below it successfully creates the
service. But fails to start saying "Logon Failure" message. However,
if I go to the windows service window (services.msc) and right click
service and then go to properties->Log On and enter the same password
and then start the service it all works fine.
Please help if you have ever encounter this before? I do not understand
what is going on. (I am logged in as Adminstrator when I run this
script)
myService.ruby
------------------------------------------------------------------------
require "win32/service"
include Win32
Service.create("MyService", nil,
:description => "My Ruby Service",
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => "C:\myService.exe",
:display_name => "MyService",
:service_start_name => "domain\\myUser",
assword => "myPass",
:service_type=> Service::SERVICE_WIN32_OWN_PROCESS
)
Service.start("MyService")