B
B
barkalov2014-07-24 17:00:53
Node.js
barkalov, 2014-07-24 17:00:53

How does daemonizing node.js work in Ubuntu?

I apologize right away if the question seems stupid to someone - I've been with Linux for a week.
I know there are:

  • Daemons like smbd that are started by start/restart/etc...
  • Servers like nginx that are started via /etc/init.d with start/restart/etc...
  • There are probably about a trillion other ways to autostart something in the background.

Question number 1: Which method of demonization is considered the most canonical and ideologically correct in Ubuntu.
Question #2: What is the best way to do this with a node.js application? There are too many solutions googled: from node-way forever and daemonize2 , to hardcore nohup &. How right?
Ideally, you want (in order of importance):
  1. Ubuntu way.
  2. Easy installation of the solution on a combat server.
  3. Throwing a stop/restart/etc... event to node so that it can deinitialize before the process is killed.
  4. Dev-mode with auto-restart after unhandlend exception.

Thanks for the help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Popov, 2014-07-24
@barkalov

forever

S
sasha, 2014-07-24
@madmages

screen node server.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question