Webrick:Daemonize under Windows

Hey!

How do i run Webrick as Daemon under Windows, since the fork() command
is not supported?

Are Threads an Option? Can somebody give me some input on this?

thx ck

···

--
Posted via http://www.ruby-forum.com/.

You want to run as a service instead. I think win32-service does this.

···

On Nov 14, 2007, at 22:55 , Christian Kerth wrote:

Hey!

How do i run Webrick as Daemon under Windows, since the fork() command
is not supported?

Are Threads an Option? Can somebody give me some input on this?

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars

Yes. It's actually bundled up for you already in the 'ruby-services'
package. Download the zip file, unzip it and read the instructions.
There are also services for fri and rubygems' gem server.*

http://rubyforge.org/frs/?group_id=85&release_id=8222

Regards,

Dan

* Which I will likely need to update once rubygems 0.9.5 is released.

···

On Nov 15, 3:45 am, Eric Hodel <drbr...@segment7.net> wrote:

On Nov 14, 2007, at 22:55 , Christian Kerth wrote:

> Hey!

> How do i run Webrick as Daemon under Windows, since the fork() command
> is not supported?

> Are Threads an Option? Can somebody give me some input on this?

You want to run as a service instead. I think win32-service does this.

Daniel Berger wrote:
How is this service API working? Is this a wrapper around the windows
service api? Do i need admin privileges for creating a service? I don't
necessarily have admin rights in this application.

···

On Nov 15, 3:45 am, Eric Hodel <drbr...@segment7.net> wrote:

On Nov 14, 2007, at 22:55 , Christian Kerth wrote:

> Hey!

> How do i run Webrick as Daemon under Windows, since the fork() command
> is not supported?

> Are Threads an Option? Can somebody give me some input on this?

You want to run as a service instead. I think win32-service does this.

Yes. It's actually bundled up for you already in the 'ruby-services'
package. Download the zip file, unzip it and read the instructions.
There are also services for fri and rubygems' gem server.*

http://rubyforge.org/frs/?group_id=85&release_id=8222

Regards,

Dan

* Which I will likely need to update once rubygems 0.9.5 is released.

--
Posted via http://www.ruby-forum.com/\.

Yes, it uses the Windows Service API. Yes, you'll likely need admin
privileges to install it as a service.

If you want to simply background the process, take a look at the
'start' command.

Regards,

Dan

···

On Nov 16, 1:04 am, Christian Kerth <christian.ke...@dynamicmedia.at> wrote:

Daniel Berger wrote:

How is this service API working? Is this a wrapper around the windows
service api? Do i need admin privileges for creating a service? I don't
necessarily have admin rights in this application.

Daniel Berger wrote:

If you want to simply background the process, take a look at the
'start' command.

Regards,

Dan

Where do i find this "start" command? Standard Ditro or do i need
Win32-API...

thx CK

···

--
Posted via http://www.ruby-forum.com/\.

Open up a command shell and type "start /?". :slight_smile:

Regards,

Dan

···

On Nov 16, 6:25 am, Christian Kerth <christian.ke...@dynamicmedia.at> wrote:

Daniel Berger wrote:
> If you want to simply background the process, take a look at the
> 'start' command.

> Regards,

> Dan

Where do i find this "start" command? Standard Ditro or do i need
Win32-API...

Daniel Berger wrote:

Daniel Berger wrote:
> If you want to simply background the process, take a look at the
> 'start' command.

> Regards,

> Dan

Where do i find this "start" command? Standard Ditro or do i need
Win32-API...

Open up a command shell and type "start /?". :slight_smile:

Regards,

Dan

The actual example is, i want to run an application that consists of
serveral parts:

- a webrick server
- a background updater

Prerequisites are:

- windows (so no daemonize)
- no admin rights (so a service under windows is not possible)

No what is really the best option to spawn those two parts as different
processes/threads and do not loose control over them. It must be
possible to quite or restart those processes if needed from the main
script.

thx ck

···

On Nov 16, 6:25 am, Christian Kerth <christian.ke...@dynamicmedia.at> > wrote:

--
Posted via http://www.ruby-forum.com/\.

The actual example is, i want to run an application that consists of
serveral parts:

- a webrick server
- a background updater

Prerequisites are:

- windows (so no daemonize)
- no admin rights (so a service under windows is not possible)

No what is really the best option to spawn those two parts as different
processes/threads and do not loose control over them. It must be
possible to quite or restart those processes if needed from the main
script.

thx ck

Still no satisfying solution......can somebody help?

thx

···

--
Posted via http://www.ruby-forum.com/\.

Daniel suggestion was good, windows have a "start.exe" application
that spawn new process with specific command line.

Since you need "control" them, you should start look at other tools
beyond this topic.

I could suggest you take a look at mongrel_service, which is a service/
console implementation to run ruby+mongrel+rails made in freebasic:

http://mongrel.rubyforge.org/svn/trunk/projects/mongrel_service/

All the requirements are listed in the README.

Take a look at the code, it implements a "console" mode that let you
start/stop (ctrl-c) the background process.

HTH,

Luis

···

On Dec 5, 10:42 am, Christian Kerth <christian.ke...@dynamicmedia.at> wrote:

> The actual example is, i want to run an application that consists of
> serveral parts:

> - a webrick server
> - a background updater

> Prerequisites are:

> - windows (so no daemonize)
> - no admin rights (so a service under windows is not possible)

> No what is really the best option to spawn those two parts as different
> processes/threads and do not loose control over them. It must be
> possible to quite or restart those processes if needed from the main
> script.

> thx ck

Still no satisfying solution......can somebody help?