# SCGI + Rails at System Startup

**URL:** <https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264>\
**Category:** Rails\
**Created:** [July 28, 2006, 2:03am UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264 "2006-07-28T02:03:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![porkface](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@porkface](https://www.ruby-forum.com/u/porkface)\
**Post date:** [July 28, 2006, 2:03am UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264/1 "2006-07-28T02:03:00Z")

</div>

All of the documentation for scgi\_ctrl says to run it from your Rails  
app directory, and I can’t get it to run from a single command line like  
you would in a system startup script.

I’ve tried:  
scgi\_ctrl -c /www/myapp/config/scgi.yaml start

…but that just errors out unless I run it from within the root of my  
rails app (/www/myapp).

---

<div class="post-metadata">

**Author:** ![porkface](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@porkface](https://www.ruby-forum.com/u/porkface)\
**Post date:** [July 28, 2006, 8:41am UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264/2 "2006-07-28T08:41:51Z")

</div>

Hi porkface,

aren’t you able to run something like cd /path/to/rails/root/ &&  
scgi\_ctrl  
start as a single liner on your startup script.

I’ve just tried something like this on the command line on a box with an  
old  
scgi installation and it seems to work (haven’t tried to run the command  
from a startup script though). At least you should be able to but this  
into  
an shell script and let this be run by your startup script.

I’ve used to use scgi\_rails too but now am a happy mongrel user. Is  
there a  
reason why you are relying on scgi? This seems to get not as many love  
by  
zed as mongrel is getting…

Cheers,  
Jan

---

<div class="post-metadata">

**Author:** ![porkface](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@porkface](https://www.ruby-forum.com/u/porkface)\
**Post date:** [July 28, 2006, 4:18pm UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264/3 "2006-07-28T16:18:34Z")

</div>

not a lot of help but i know you can specify the start up directory with  
a  
switch, just cant remember what it is (or even how to get  
help - ‘scgi\_ctl -h’ ? ;been some months, used to have it in a cron job  
so i  
know it works for sure)

that said, mongrel is your friend - i’m pretty sure mr shaw isn’t even  
doing  
anything with scgi now, best to jump ship, tha doggies rock

---

<div class="post-metadata">

**Author:** ![porkface](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@porkface](https://www.ruby-forum.com/u/porkface)\
**Post date:** [July 28, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264/4 "2006-07-28T19:57:48Z")

</div>

The documentation say’s you can use the -r switch to specify the run  
path. It doesn’t appear to work for me. Also, you have to provide a  
password to shut scgi down, which makes stopping it via a script more  
complicated.

Chris

---

<div class="post-metadata">

**Author:** ![porkface](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@porkface](https://www.ruby-forum.com/u/porkface)\
**Post date:** [July 28, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/scgi-rails-at-system-startup/100264/5 "2006-07-28T20:10:08Z")

</div>

snacktime wrote:

> The documentation say’s you can use the -r switch to specify the run  
> path. It doesn’t appear to work for me. Also, you have to provide a  
> password to shut scgi down, which makes stopping it via a script more  
> complicated.

Yeah, I read several messages in various places saying people couldn’t  
get the -r switch to work as intended.

Looks like I’m switching to Mongrel, although I may do some benchmarks  
first out of curiosity.

Thanks everyone.
