# Reverse proxy holding onto port, complicated

**URL:** <https://www.ruby-forum.com/t/reverse-proxy-holding-onto-port-complicated/104977>\
**Category:** Rails\
**Created:** [May 24, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/reverse-proxy-holding-onto-port-complicated/104977 "2007-05-24T15:34:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uncle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e5b9ba/32.png) [@uncle](https://www.ruby-forum.com/u/uncle)\
**Post date:** [May 24, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/reverse-proxy-holding-onto-port-complicated/104977/1 "2007-05-24T15:34:43Z")

</div>

I have a rails app that is behind a firewall and I need to be able to  
ssh into the box, so I do this…

- create a reverse tunnel from the rails system to my system using ssh  
-R
- ssh from my system to the rails system thru the reverse tunnel

It works great !

But, if/when I restart my mongrel cluster, one of the mongrels always  
fails with an “port in use” error.

I guess what’s happening is my reverse tunnel ssh process is a child  
of a mongrel process, and when I kill the mongrel process, the reverse  
tunnel ssh process is still holding onto the port, in fact i can see  
that with “fuse -n tcp 8001” for port 8001.

So the question is, how can I keep this from happening, I want to be  
able to restart my cluster and not have any lingering ports screw me  
up !
