Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I am working on a Node app that must:
The product will remain in active development at the same time it is deployed, for the foreseeable future.
It's running on Ubuntu 18.04.3 (LTS) x64 on digitalocean.com.
I am currently using
This method seems pretty good. I am able to Control-C after launching the app and it keeps running in the background. It seems to survive closing the terminal and logging on again.
Curious to know what other devs think? What method do you use to launch and kill an app in the background when you're actively developing it?
With your requirements, this is what I would do. (Actually, I run everything inside Docker containers, now. But before I started doing that, this is what I would have done.)
I'd use "systemd" to manage the node process. That way it gets started when/if the machine reboots. It can also automatically restart the process after a crash. Systemd is already installed on ubuntu and is responsible for managing pretty much every persistent process and subsystem, so you won't have to worry about installing extra software.
This article looks like a decent overview of configuring a systemd managed node app. All it takes a 10-15 line config file.