kandanapp / kandan

Kandan is an Open Source Alternative to HipChat
GNU Affero General Public License v3.0
2.72k stars 407 forks source link

How to run Kandan in 'silent mode' / as a service #319

Closed Kovah closed 10 years ago

Kovah commented 10 years ago

Hi guys, I got the Kandan app to run on my Ubuntu 12.04 server with Apache. I can access the app but I have the problem that my terminal has to stay open to keep the Kandan app running. After running

bundle exec thin start

I get

Listening on 0.0.0.0:3000, CTRL+C to stop

and can't do anything. If I close the terminal the app stops.

Is there any way to run Kandan in "silent mode" or as a service (service kandanchat start)?

jimmybrancaccio commented 10 years ago

Run it in screen. Or run it appending '&'.

Kovah commented 10 years ago

What exactly means "Run it in screen"? With appending '&' it would be 'bundle exec thin start &'?

mjtko commented 10 years ago

The easiest way to run it as a background service is to perform:

bundle exec thin start -d

The -d tells thin to run 'daemonized'. See thin --help for all the options.

How you configure your machine to run it as a service (ie. daemonized at startup) is operating system and distribution dependent. For example though, I have the following in /etc/rc.local which is executed as the final step of boot on my system:

cd /srv/kandan
bundle exec thin start -p 3040 -e production -t 60 -d

HTH!

Kovah commented 10 years ago

Awesome, it's working! Many thanks!

Maybe this could be added to the DEPLOY.md for beginners like me.