jetty restart on RHEL

96 views
Skip to first unread message

Jonathan Rochkind

unread,
Sep 27, 2012, 3:52:35 PM9/27/12
to capis...@googlegroups.com
Has anyone managed to get capistrano to restart a jetty on a RHEL server?

I can not get it to work, and I'm not sure why. However capistrano is
executing commands, the jetty that gets started up seems somehow tied to
the capistrano session, and ends up getting killed when cap logs out of
the remote server.

Just trying (run "#{sudo} /etc/init.d/jetty restart"). No errors are
reported, but jetty is not running. If I add a "&& sleep 60" on the end,
then jetty is started up and runs as long as the sleeping is happening,
then it's gone.

I've tried setting :pty => true and :shell => true, neither/both seems
to make a difference.

Anyone managed to figure this out, or have any clues?

Todd Courtnage

unread,
Sep 27, 2012, 4:01:28 PM9/27/12
to capis...@googlegroups.com
I struggled with something like this as well.  In my case, it was strying to start solr (using jetty). The difference is, we start it using phing, but here's how I did it:
nohup phing solr-start > /dev/null 2> /dev/null

The trick seemed to be starting it with nohup and redirecting stdout and stderr to /dev/null.  This allows it to disconnect from the capistrano session and continue running in the background.



--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en



--
Todd Courtnage
Director of Cloud Computing

Chaordix – Crowd Intelligence
office: +1.403.263.2655
toll free: +1.866.263.7775

Jonathan Rochkind

unread,
Sep 27, 2012, 4:19:03 PM9/27/12
to capis...@googlegroups.com, Todd Courtnage
Huh, I guess I'll mess with that. Anyone know why this seems to be
neccesary with jetty, when it's not with other init.d scripts to start
deamon? It's too bad to lose the output of the /etc/init.d/jetty in the
cap output.
> <mailto:capis...@googlegroups.com>
> * To unsubscribe from this group, send email to
> capistrano+unsubscribe@__googlegroups.com
> <mailto:capistrano%2Bunsu...@googlegroups.com> For more options,
> visit this group at
> http://groups.google.com/__group/capistrano?hl=en
> <http://groups.google.com/group/capistrano?hl=en>
>
>
>
>
> --
> *Todd Courtnage*
> Director of Cloud Computing
>
> Chaordix � Crowd Intelligence
>
> email: to...@chaordix.com <mailto:to...@chaordix.com>
> office: +1.403.263.2655
> toll free: +1.866.263.7775
> mob: + 1.403.975.1591
>
> http://www.chaordix.com <http://www.chaordix.com/>
>
>
> Follow us on twitter: http://twitter.com/chaordix
> Our blog: http://www.chaordix.com/blog/
>
>
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to capis...@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en

Jonathan Rochkind

unread,
Sep 27, 2012, 5:27:03 PM9/27/12
to capis...@googlegroups.com
Okay, I doubt I'll ever get to the bottom of it, but I'm trying to
figure out what's going on in the code anyway, which is leading me to
reading Net::SSH api docs, etc. I probably wont' figure out anything
useful out, but, hey, it's an education.

Can anyone familiar wtih the capistrano code tell me where in the cap
code Net::SSH::Sessions get opened, and, if it isn't being opened in
block form that closes itself after the block, where they get closed?
Having trouble finding it. Thanks if anyone can give me a tip!

Rafa García

unread,
Oct 8, 2012, 5:02:18 AM10/8/12
to capis...@googlegroups.com
You will find in lib/capistrano/configuration/connections.rb the methods connect_to that end calling SSH.connect (lib/capistrano/ssh.rb).

There're two instance connect_to methods (for connecting w/o gateways):
  - Capistrano::Configuration::Connections::DefaultConnectionFactory#connect_to
  - Capistrano::Configuration::Connections::GatewayConnectionFactory#connect_to

I hope it helps a little bit, despite it's a bit late.

Regards

2012/9/27 Jonathan Rochkind <roch...@jhu.edu>

    * To unsubscribe from this group, send email to
    capistrano+unsubscribe@__googlegroups.com
    <mailto:capistrano%2Bunsu...@googlegroups.com> For more options,
    visit this group at
    http://groups.google.com/__group/capistrano?hl=en
    <http://groups.google.com/group/capistrano?hl=en>




--
*Todd Courtnage*
Director of Cloud Computing

Chaordix – Crowd Intelligence


email: to...@chaordix.com <mailto:to...@chaordix.com>
office: +1.403.263.2655
toll free: +1.866.263.7775
mob: + 1.403.975.1591

http://www.chaordix.com <http://www.chaordix.com/>


Follow us on twitter: http://twitter.com/chaordix
Our blog: http://www.chaordix.com/blog/


--
* You received this message because you are subscribed to the Google
Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

Reply all
Reply to author
Forward
0 new messages