Startup script

Hi,

I just started ruby on rails. Would it be possible to create a start
script
that I can use on boot?

/etc/init.d/my_rails_init_script.sh {start|stop}

I’ve search the web and I can’t find any.

Thanks,

Jay

Generally, you only start the Rails application directly if you’re
hosting it locally, for development purposes. For all other forms of
deployment (public) you would have a Web server to front-end requests
and pass them along to your Rails app, which would be running in
Passenger or Thin or another application server. That would be the thing
you would start, not Rails itself. In the case of Passenger, it starts
when Apache does, and keeps Rails hot and ready to receive requests as
long as Apache is running.

Starting up Apache or Nginx at system boot is a really well-soved
problem, you would probably have a harder time getting it to not start
at boot.

Walter

On Thu, Feb 27, 2014 at 7:59 AM, Walter Lee D. [email protected]
wrote:

For all other forms of deployment (public) you would have a Web server to
front-end requests and pass them along to your Rails app, which would be running
in Passenger or Thin or another application server.

Yes, and that “another application server” needs to be started, so –
not sure what your point is.

To the OP - one app server, Puma, comes with an init.d script; you
might get some ideas from that even if you choose another server.

( See https://github.com/puma/puma under ‘tools’ )

Good luck,

Hassan S. ------------------------ [email protected]

twitter: @hassa

On 27 February 2014 15:52, Jay A. [email protected] wrote:

Hi,

I just started ruby on rails. Would it be possible to create a start script
that I can use on boot?

/etc/init.d/my_rails_init_script.sh {start|stop}

Can you explain why you want to do this? It is a bit unusual for
someone just starting rails to want a server running from boot,
assuming that is what you mean to achieve.

What would be in the startup script to start the server?

Colin

My point is that “starting rails” at system start smells of someone
trying to host production in Webrick.

Walter

On Friday, February 28, 2014 4:33:05 AM UTC, Jay A. wrote:

Typically people don’t use rails server in production, which is
probably
why you haven’t found any examples of that. You’re more likely to use
something like unicorn, puma, passenger (either the standalone version
or
the nginx/apache module version) and you shouldn’t have trouble finding
startup scripts for those.

Fred

I can not figure out why it can not be done… if you put a symbolic
link
for your ruby binary, you just need to do something like

/etc/init.d/start_fancy_ruby_script.sh

/bin/ruby

puts “Your fancy script works”

On Fri, Feb 28, 2014 at 8:31 AM, Frederick C. <

Oh sorry… only now I figured out that I was answering on a rails
group…
so it could be about a rails app that you need to start with init.d

In that case… you can also use a script… but it is a more complicated
one…

As recommended above, it’s better use passenger or unicorn…

On Fri, Feb 28, 2014 at 11:28 AM, Carlos Figueiredo <

I just want that every time i restart my server, rails would also be up
and
running. No need for me to login and cd to your rails apps and then type
rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on
the
backend.

The thing is my current rails don’t comes with a startup/init script. I
hope that someone already did that and would like to share.

Jay

Now I get it. Thanks guys for pointing me to the right direction.

Jay

On Fri, Feb 28, 2014 at 7:31 PM, Frederick C. <

www.phusionpassenger.com