Running on startup (PM2 preferably)
I'm following the docs (I think they are a bit outdated in some places) and by the end of the installation it says I can start the server with a
systemctlcall like this:
sudo service nodebb start
But the service doesn't exist after the installation process. I tried using the service file provided in the docs, but the command is wrong (it needs to pass the
startargument) and it doesn't work (no errors, but the server is not up).
I'm setting it up on Digital Ocean, and I'm planning on using Nginx to manage SSL and other redirections we need to implement. On their guides, they recommend using PM2 and I actually quite like it. I managed to setup the NodeBB process using:
pm2 start /opt/nodebb/nodebb -- start
pm2 monitI can see the server constantly restarting with a SIGINT. The app is serving the page on the right port, everything is working fine, but the monitor shows that the app is constantly restarting. I tried using
nodebb startand it errors out after 15 restarts, and executing pm2 with
-x(loader or nodebb) doesn't change anything.
Is there a correct way of setting up NodeBB as a service, preferably using PM2?
You should just use
app.jsinstead of loader or NodeBB if you're using pm2. Nobody here uses pm2 to run NodeBB because it's not very compatible with our clustering method.