[Rg 143] Restarting Ramaze via net-ssh
Lars Olsson
lasso at lassoweb.se
Tue Jan 29 15:37:17 EST 2008
Hi list!
The following isn't strictly a Ramaze question, more of a Unix question,
but since it involves Ramaze maybe someone has experience with something
similar?
I'm having some problems with my Mongrel + Ramaze setup at the moment,
which means I occasionally have to login via SSH to a shared host and
restart the server. The steps I usually take are:
1. Find out if any old Ramaze process is running and what pid that
process has: `ps xU username`
2. Kill Ramaze process: `kill some_pid`
3. Restart Ramaze: `cd ramaze_folder; ruby -rubygems main.rb &`
Since I have the net-ssh gem installed on my local (Windows) machine I
thought it would be a good idea to automate this process. I wrote a
small script that sent the commands via net-ssh instead. Step 1 (finding
the pid) works nicely, but step 2 and 3 are giving me trouble.
When killing Ramaze (step 2) the script stalls with the message
'Shutdown Ramaze (it's safe to kill me now if i hang)'
If I log in via SSH I can see that the process has been killed, but the
kill command just doesn't return anything (and thus stalls the script).
When starting the server again the script again stalls with the
following messages (coming from Og)
'INFO: Og uses the Sqlite store.'
'INFO: Og uses the Sqlite store.'
'INFO: Og uses the Sqlite store.'
Again, the server seems to start, it's just not returning any result
(and thus stalls the script).
I tried using both channels and the popen3 method (see
http://net-ssh.rubyforge.org/chapter-4.html) but the result seems identical.
Any hints on why this happens and what I can do about it?
Kindly
/lasso
--
________________________________________
Lars Olsson
lasso at lassoweb.se
http://www.lassoweb.se/
More information about the Ramaze-general
mailing list