# Unified ferret\_start and ferret\_stop

**URL:** <https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683>\
**Category:** Ferret\
**Created:** [October 8, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683 "2007-10-08T18:51:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [October 8, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683/1 "2007-10-08T18:51:43Z")

</div>

I would like to unify the ferret\_start and ferret\_stop scripts into a  
single script. My motivation is to make the scripts more like the other  
rails scripts, and to also make it fit into monitoring schemes better.  
I realize that some work was done recently to allow the scripts to be  
run from script/runner, but I think a unified script is a better  
approach.

A unified script would allow more advanced command line processing  
without duplication. For example, being able to supply the RAILS\_ENV on  
the command line, and overriding configuration options such as the PID  
file.

Would there be any objection to me submitting patches that unified these  
two scripts? Here is what I would expect them to look like in the  
future (after my patches):

script/ferretd -e production start  
script/ferretd -e production stop

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [October 9, 2007, 9:17am UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683/2 "2007-10-09T09:17:54Z")

</div>

Hi!

sounds great, just go ahead 🙂

cheers,  
Jens

On Mon, Oct 08, 2007 at 06:51:44PM +0200, Peter J. wrote:

> file.  
> Ferret-talk mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/ferret-talk](http://rubyforge.org/mailman/listinfo/ferret-talk)

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [October 22, 2007, 7:14pm UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683/3 "2007-10-22T19:14:30Z")

</div>

I’ve tweaked the ferret server scripts a bit. Made them a little more  
modular. Peter, feel free to email me if you want to discuss things.

Also, I’m learning about threading and forking. My tentative thought is  
that the use ‘safefork’ (a while loop encapsulating a Kernel#fork) might  
be  
able to be improved upon. The examples in The Ruby Way by Fulton seem  
cleaner – they don’t use Kernel#fork. Again, all of this is tentative;  
just thinking out loud.

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [October 23, 2007, 1:04am UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683/4 "2007-10-23T01:04:05Z")

</div>

Can we have a look at the source?

(sorry if I’m missing something and you already put it somewhere)

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [October 25, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/unified-ferret-start-and-ferret-stop/116683/5 "2007-10-25T22:14:39Z")

</div>

I’ve attached my first set of changes. The attached archive includes a  
README file with information about what I’ve changed and why.

These changes are only for Unix-like operating systems, for now. If you  
like the changes I’ve made, I’ll integrate the Windows code from the  
various scripts in the script directory.

Let me know if you have any questions.
