exception handling - Interrupt Rails Server Output w/o Stopping the Server during a Capistrano Deployment -


I am deploying a capitals of a rail app. This is a lot of fun for the most part.

After completion of the deployment ( deployment: restart ), I would like to start the rail server, see output for one time, and then send a code Press Ctrl-C for, preventing output and deploying : cleanup running a task at one point it seemed that it was working, except that it One was considering being in the middle of being an exception and was saying that "this rail is all And could not start "although it was actually started and was running. I wanted to save the gap, and therefore based on the following, based on the following:

  namespace: do the deployment work: restart, roles = & gt; : App, except: = gt; {: No_release = & gt; True] Start logger.info 'attempt to start' Rail Server 'run "CD # {release_path} & Script / Rail" Rescue system accelerated, interrupt logger.info% q [Au revoir! and do not worry. The server will continue to run properly without hanging around looking at your shoulder.] Avoid exception = & gt; Error logger Important 'Rail Server can not start this may be a problem. "Logger.info" # {error} "End End   

However, this does not work. Before pressing Ctrl-C, the server is still running, as I hope, I'm getting something like this:

  ** [out :: server.example .com] "/assets/bootstrap.js?body=1" for 178.120.25.53 2012-07-09 19:10:53 receive at +0000 ** [out :: server.example.com] of service Property / bootstrap.js - 200 OK (11 mms)   

and then I send the interface, I get this:

  ** Au revoir! and do not worry. The server will continue to do fine without hanging without looking at your shoulder. 'Trigger after callback for deployment: * execute' deployment: cleanup '* executed "ls -xt / srv / www / my_project / release" server: ["server.example.com"] [server.example.com] The executed command command ended in 774 mms ** 2 deployment releases out of 1 * "RM-RF / SRV / www / my_project / release / 20120709190209" implementing server: ["server.example.com"] [server .example.com] The command command execution ended in 811ms   

that looks correct ... but as It turns out, train, indeed, is still running, as running as before and after went procedures described in grep. Before Ctrl-C , I see both Capistrano Command (19358), and this Rail Server started (197507):

  User @ Server .example.com: ~ $ ps ax | GRP Rails | Grep -v grep 19358 points / 1s + 0:01 bash-c cd / srv / www / my_project / releases / 20120709190521 & amp; Amp; Script / rail 19507 points / 1 SL + 0:41 ruby ​​script / rail << / code>  

after Ctrl-C , rail server now There, or it appears:

  user@server.example.com: ~ $ ps ax | GRP Rails | Grep -v grep 19507? Sl 0:41 ruby ​​script / rails s   

But when I try to kill the site in a web browser, it disappears! Strange Eh?

  user@server.example.com: ~ $ ps ax | GRP Rails | Grep -v grep user@server.example.com: ~ $ [no output; Back to prompt]   

So, my question is: How do I do this? How do the separation between the moving rail process and the capisrono separate, allowing the Capitolano to move on to the remaining tasks, and then repeat the terminal prompt to leave the terminal server back to me? Any help would be appreciated.

I have now come to know that this was a PEBCAC error in my Capistranos script initialization-ending block My inbound was not catching Ctrl-C, it was only passing in the running Rail Server process that ran out of SystemX0, which was compulsively removed from the system by the capitrano The script was passed, after which it caught the exception of the outbound . It was a deal at that time. Any amount of capture and control of the outbound exceptions from within the context of the Capistrano script was never going to stop the rail server from halting. So, I understand why this was not working, but if I was trying to do this then I am still curious. This would mean that it could be sent to the server before capturing the population within me somewhere in the Capistorno.

Comments