Forum: Ruby to run window service using ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-04-08 06:00
Hi...
how to run window service using ruby.
i have exe file for making it to run i have to click it on.
but i want to make it to run using ruby.

Kindly Help me get along with ruby...

Thank you
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-08 06:11
(Received via mailing list)
Newb Newb wrote:
> Hi...
> how to run window service using ruby.
> i have exe file for making it to run i have to click it on.
> but i want to make it to run using ruby.
>
> Kindly Help me get along with ruby...

If by 'window service' you mean the program starts when you turn on your
desktop...

...put the ruby.rb file into your Start menu's Startup folder. Yes it
will open
a little window. You can use rubyw.exe to fix that.

A true "windows service" is like a daemon. You run in a special place
with
limited facilities, and it's generally no picnic for a beginner. I have
run many
desktop apps from the Startup menu, including a lite Ruby wiki for my
PIM, and I
never had any issue with it...
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-04-08 06:42
Phlip wrote:
> Newb Newb wrote:
>> Hi...
>> how to run window service using ruby.
>> i have exe file for making it to run i have to click it on.
>> but i want to make it to run using ruby.
>>
>> Kindly Help me get along with ruby...
>
> If by 'window service' you mean the program starts when you turn on your
> desktop...
>
> ...put the ruby.rb file into your Start menu's Startup folder. Yes it
> will open
> a little window. You can use rubyw.exe to fix that.
>
> A true "windows service" is like a daemon. You run in a special place
> with
> limited facilities, and it's generally no picnic for a beginner. I have
> run many
> desktop apps from the Startup menu, including a lite Ruby wiki for my
> PIM, and I
> never had any issue with it...


Thanks for the reply...

Actually i run qt program as windows service.

to start and restart i manually give command in the windows command
prompt.

now i would like to know how to run this program using our ruby...

any command or something...

pls help
44209be79f73baf672b07f462d8d8bc7?d=identicon&s=25 Vikhyat Korrapati (celebrus)
on 2009-04-08 06:46
Newb Newb wrote:
> Thanks for the reply...
>
> Actually i run qt program as windows service.
>
> to start and restart i manually give command in the windows command
> prompt.
>
> now i would like to know how to run this program using our ruby...
>
> any command or something...
>
> pls help

You can run any command as if run in a command line using the system
method, like this:

system('command to run')
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-04-08 07:02
Vikhyat Korrapati wrote:
> Newb Newb wrote:
>> Thanks for the reply...
>>
>> Actually i run qt program as windows service.
>>
>> to start and restart i manually give command in the windows command
>> prompt.
>>
>> now i would like to know how to run this program using our ruby...
>>
>> any command or something...
>>
>> pls help
>
> You can run any command as if run in a command line using the system
> method, like this:
>
> system('command to run')

thanks much..
just curious to know about ruby classes.


Is it possible to run using ruby if so how....

Thanks
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-04-08 11:11
Newb Newb wrote:
> Vikhyat Korrapati wrote:
>> Newb Newb wrote:
>>> Thanks for the reply...
>>>
>>> Actually i run qt program as windows service.
>>>
>>> to start and restart i manually give command in the windows command
>>> prompt.
>>>
>>> now i would like to know how to run this program using our ruby...
>>>
>>> any command or something...
>>>
>>> pls help
>>
>> You can run any command as if run in a command line using the system
>> method, like this:
>>
>> system('command to run')
>
> Now i did start stop and continue and pass the windows service.
but how to Restart a windows service...
What command is needed.

Pls help me
Dfa842ab64f794363e66d7cce85ba277?d=identicon&s=25 Alexey Borzenkov (snaury)
on 2009-04-09 22:39
>> Now i did start stop and continue and pass the windows service.
> but how to Restart a windows service...
> What command is needed.

Have a look at win32-service gem

http://raa.ruby-lang.org/project/win32-service/

If you want to create a service that is written in ruby, then code
sample there is horribly outdated and you will need to read source code
and comments to understand how to do it in the new style. But if you
want to start/stop/restart some other service, then it works just like
on that page. Have a look.
This topic is locked and can not be replied to.