# Start mongrel in ssh session and then exit in Ubuntu 10.04

**URL:** <https://www.ruby-forum.com/t/start-mongrel-in-ssh-session-and-then-exit-in-ubuntu-10-04/196077>\
**Category:** Rails\
**Created:** [October 6, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/start-mongrel-in-ssh-session-and-then-exit-in-ubuntu-10-04/196077 "2010-10-06T12:12:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duy\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Duy\_L](https://www.ruby-forum.com/u/Duy_L)\
**Post date:** [October 6, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/start-mongrel-in-ssh-session-and-then-exit-in-ubuntu-10-04/196077/1 "2010-10-06T12:12:22Z")

</div>

Hi all,

I’m deploying a Rails application in a Ubuntu 10.04 server with  
mongrel web server. I connect to server and do stuffs in a ssh client  
(PuTTY). And I’m getting stuck with a strange issue:

1. After I connected to server, I start mongrel with : $ start-stop-  
daemon -S -d . -x script/server -b – -p 8080
2. I left the ssh console and launch firefox from my Win7 box and open  
the website, it runs well. I can see the homepage
3. I go back to the ssh console. Close the terminal (and window too)  
it by : $ exit
4. Then in firefox, I press F5 to refresh and nothing shows up. It’s  
just an empty space in whole webpage. I tried to use addon to capture  
the HTTP data and see that the server returns nothing , even HTTP  
headers

I thought that using start-stop-daemon command could help me run  
mongrel as daemon and then I can exit my session just as apache does.  
But it doesn’t work.

Do I miss something ?

Duy

---

<div class="post-metadata">

**Author:** ![Duy\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Duy\_L](https://www.ruby-forum.com/u/Duy_L)\
**Post date:** [October 6, 2010, 1:36pm UTC](https://www.ruby-forum.com/t/start-mongrel-in-ssh-session-and-then-exit-in-ubuntu-10-04/196077/2 "2010-10-06T13:36:04Z")

</div>

Updated the message with two more steps

1. I connect to server again, run “ps -Af” to check and see that the  
process’s still running. And again, leave the console, switch to  
firefox and refresh -\> the homepage shows everything.
2. But if I exit the ssh session and refresh browser, the web server  
returns nothing again

---

<div class="post-metadata">

**Author:** ![Duy\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Duy\_L](https://www.ruby-forum.com/u/Duy_L)\
**Post date:** [October 6, 2010, 7:19pm UTC](https://www.ruby-forum.com/t/start-mongrel-in-ssh-session-and-then-exit-in-ubuntu-10-04/196077/3 "2010-10-06T19:19:07Z")

</div>

Quoting Duy L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> it by : $ exit  
> 4. Then in firefox, I press F5 to refresh and nothing shows up. It’s  
> just an empty space in whole webpage. I tried to use addon to capture  
> the HTTP data and see that the server returns nothing , even HTTP  
> headers
> 
> I thought that using start-stop-daemon command could help me run  
> mongrel as daemon and then I can exit my session just as apache does.  
> But it doesn’t work.

Possible workaround, ssh into server, at shell type “screen”, hit space  
bar,  
start server, type control-A control-D to detach from screen, logout of  
SSH  
session. Later you can log in and type “screen -r” to resume the screen  
session.

I also find this very useful for long operations on remote systems that  
might  
lose the connection (e.g. dialup and wifi).

HTH,  
Jeffrey
