# Script for production server

**URL:** <https://www.ruby-forum.com/t/script-for-production-server/190536>\
**Category:** Ruby\
**Created:** [June 22, 2010, 11:39am UTC](https://www.ruby-forum.com/t/script-for-production-server/190536 "2010-06-22T11:39:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 22, 2010, 11:39am UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/1 "2010-06-22T11:39:45Z")

</div>

Hello,

I’m pretty new with ruby and I’ve just installed retrospectiva with  
success within ruby enterprise edition.  
I ran with success the command : /XXXXX/bin/ruby script/server -e  
production -p3000  
Unfortunately as I close the shell, the server shut down.  
How can I test that the server is in production in order to make it as a  
service in a script.

best regards

---

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 22, 2010, 11:47am UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/2 "2010-06-22T11:47:56Z")

</div>

This is not a ruby specific problem.

All processes started “normally” from a shell are terminated when the  
shell exits.

There are many, many posibillities to avoid this, the most easy way  
would be the use of the programm screen. But it has several  
diadvantages.

I suggest to use a process supervisor (it will restart your programm  
when it crashes, and takes care of starting it after your server comes  
up).

Personally I use:

supervise (from djbs deamontools) and  
monit

Feel free to google 😉

Mfg

Markus

---

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 22, 2010, 11:52am UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/3 "2010-06-22T11:52:03Z")

</div>

Thanks a lot for your answer.

I will search in this direction.  
I was just wondering if there is a ruby command to test wether an  
application runs or not.  
Best regards

Le mardi 22 juin 2010 Ã 18:47 +0900, Markus S. a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 22, 2010, 2:51pm UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/4 "2010-06-22T14:51:09Z")

</div>

Also you can use the nohup command this prevents that the command ends  
on shell exit.

hackob desde BlackberryÂ®.

---

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 23, 2010, 8:12am UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/5 "2010-06-23T08:12:02Z")

</div>

thanks for all your answers.  
I found a package that works fine in Centos via webmin.

Best regards

Le mardi 22 juin 2010 Ã 21:50 +0900, removed\_email\_address@domain.invalid a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Florent\_THOMAS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@Florent\_THOMAS](https://www.ruby-forum.com/u/Florent_THOMAS)\
**Post date:** [June 24, 2010, 5:42pm UTC](https://www.ruby-forum.com/t/script-for-production-server/190536/6 "2010-06-24T17:42:44Z")

</div>

Florent THOMAS wrote:

> Hello,
> 
> I’m pretty new with ruby and I’ve just installed retrospectiva with  
> success within ruby enterprise edition.  
> I ran with success the command : /XXXXX/bin/ruby script/server -e  
> production -p3000  
> Unfortunately as I close the shell, the server shut down.  
> How can I test that the server is in production in order to make it as a  
> service in a script.
> 
> best regards

Maybe this is actually a Rails specific question? Just use the “-d” flag  
to daemonize the server.
