LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-06-2010, 05:06 AM   #1
duypl
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Question Start mongrel in ssh session and then exit in Ubuntu 10.04


Hi all,

I'm deploying a Rails application in a Ubuntu 10.04 server with
mongrel web server (a lightweight http web server). I connect to server and do stuffs in a ssh client
(PuTTY on windows). 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
5. 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.
6. But if I exit the ssh session and refresh browser, the web server returns nothing again

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
 
Old 10-07-2010, 11:34 AM   #2
mago
Member
 
Registered: Apr 2004
Location: Costa Rica
Distribution: slack current with 2.6.16.18 (still off the hook)
Posts: 284

Rep: Reputation: 33
I have no experience with Mongrel, but there is a number of ways for you to leave the command running.

You can use:
Code:
nohup start-stop-daemon -S -d . -x script/server -b -- -p 8080 &
That will through it on the background even when you close the ssh session.

Another one is install screen and run this:
Code:
screen -dmS $NAME start-stop-daemon -S -d . -x script/server -b -- -p 8080
Where $NAME is the name of the session.

Then if you want to end the session run:
Code:
screen -r $NAME
And you can use exit to ctrl+c to kill it and then exit to close the session.
 
Old 10-12-2010, 04:06 AM   #3
duypl
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Original Poster
Rep: Reputation: 0
@mago: many thanks, mate :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH concurrent session limit and idle session time out lasygsd Linux - Newbie 3 10-30-2014 07:56 AM
[SOLVED] If I exit an SSH session, would it terminate transfers from one server to another? imekul Linux - Server 2 09-09-2010 02:17 AM
Exit Session - Sort Of... GNewbie MEPIS 2 02-01-2006 01:00 AM
Start a SSH Session in the Terminal stuartmunro Linux - Newbie 4 06-15-2005 04:23 PM
Exit X Window System session Azzath Linux - Software 4 01-04-2005 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration