I want to run a nodeJS web server on a couple of machines which I don't have sudo access on. What would be a good way to do this?
The two requirements are:
- running the service without being logged in (obviously)
- automatically restarting if the machine is rebooted.
For 1., I've typically used nohup
but is this a reasonable approach for production instances?
For 2.,
I can (hackily) add a crontab
that starts the service, which will simply fail if it's already running. Is there a better way?
These servers are RHEL, but I'd prefer solutions that would also work for Ubuntu, if possible.