Ubuntu 20.04 automatically start NodeBB on startup
-
I'm not an expert with linux by any stretch of the imagination, but I do have some experience. I installed NodeBB on a Hyper-V VM running Ubuntu 20.04 and it is running perfectly. The only thing I can't figure out how to do is make it start automatically when the server boots up. I've done a lot of Googling and searching the forums but apparently I'm using incorrect syntax or I just don't understand how to make a program start automatically. The only way I can get it to start is to SSH to the server and manually run
./nodebb start
. I've never used cron or set up services in linux so I suspect I'm missing something there in what I have tried already.What is the best way to make NodeBB start automatically?
-
You want to install NodeBB as a systemd service:
-
-
@dogs This looks kind of cool. Lord knows I am not a fan of systemd but it seems like the most practical choice for NodeBB startup/restart under systemd based systems. Which is pretty much all Linux nowadays. Yeah, I get void, alpine and gentoo exist.
Other systems, however.... Seems like this pm2 could be a nice win over trad rc scripts.
Or just use something Illumos based and SMF. Maybe Tribblix or Hipster? Oh... snap.... too many folks nowadays favor writing unportable software in the name of "efficiency". Others may just call it lazyness....
In any case, nice find.