Adnan Tahir
Adnan Tahir

Reputation: 46

Run faye server on production server

I want to use Faye on production server. how can I start faye server automatically or as a daemon process.

Because when I start faye server using SSH it shutdown as i close ssh connection. Please guide me its really urgent.

I can run faye server on local but how I can rub this on live site.

Upvotes: 0

Views: 1320

Answers (3)

Ismael
Ismael

Reputation: 16730

Using Foreman + Upsart should be the best way to do it.

Upvotes: 0

Von Stark
Von Stark

Reputation: 21

I use faye as my message server currently. Perhaps you would want to make faye as a daemon. I use this for my faye app.

http://rubygems.org/gems/daemons

just

gem install daemons

and edit ur own rake file or a plain ruby to run daemon up. that's all

There are lots of daemon tools for ruby.

You can also combine faye with sinatra or thin, but it's a little bit hassle when you can use daemons and fire it up in 3 mins. :)

Upvotes: 0

fvu
fvu

Reputation: 32963

It gets stopped probably because you're running it in your session, and once that session is closed it receives a SIGHUP signal and quits.

A quick test to determine if that's really your problem is to log in, execute

nohup your_server_startup_command > /dev/null 2>&1 &

logout, and see if the server still runs. THIS IS NOT A PERMANENT SOLUTION THOUGH!

The normal way for a server is to create a management script in init.d, and then use the service management app of your Linux distro to have the service started in the appropriate runlevels. In OpenSUSE you'll use YAST for that, in Ubuntu there's sysvconfig.

There are subtle differences between Linux distros, have a look here to get a general idea of how an init.d script is supposed to look, or here for an absolute bare-bones example.

Upvotes: 1

Related Questions