# Switchtower and scgi

**URL:** <https://www.ruby-forum.com/t/switchtower-and-scgi/47536>\
**Category:** Rails\
**Created:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/switchtower-and-scgi/47536 "2005-11-12T12:49:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mje113](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@mje113](https://www.ruby-forum.com/u/mje113)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/switchtower-and-scgi/47536/1 "2005-11-12T12:49:22Z")

</div>

Has anyone figured out a proper way to get switchtower and SCGI to  
work together nicely?

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![mje113](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@mje113](https://www.ruby-forum.com/u/mje113)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/switchtower-and-scgi/47536/2 "2005-11-12T12:49:24Z")

</div>

it would work if the params to specify a path worked correctly, and if  
you could pass a password (assuming you are not on a shared box)… both  
of which i believe zed is working on

in the meantime you can manually start it, and use switchtower to issue  
a HUP signal to gracefully restart it

---

<div class="post-metadata">

**Author:** ![mje113](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@mje113](https://www.ruby-forum.com/u/mje113)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/switchtower-and-scgi/47536/3 "2005-11-12T12:49:46Z")

</div>

On 11/8/05, Jerrett T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> it would work if the params to specify a path worked correctly, and if  
> you could pass a password (assuming you are not on a shared box)… both  
> of which i believe zed is working on
> 
> in the meantime you can manually start it, and use switchtower to issue  
> a HUP signal to gracefully restart it

Actually, I managed to figure out a workable solution:

desc “Restart SCGI”  
task :restart, :roles =\> :app do  
run “cd #{current\_path} && scgi\_ctrl restart” do |channel, stream,  
data|  
if data =~ /^Password:/  
logger.info “#{channel[:host]} asked for password”  
channel.send\_data “mypassword\n”  
end  
end  
end

The only problem is, it always seems to fire off the last version of  
the application… does anyone know if updating the symlink occurs  
after the restart? I guess that would be odd.

m
