@dxxt systemctl
,
For NodeBB < 1.5 I use this configuration (read below), but I don't know if the ExecStart
script should be updated in the future:
Just create a file called nodebb.service
in /etc/systemd/system
(or /etc/systemd/user
, or any subfolder of systemd
), stop nodebb as you run it now and do:
sudo systemctl daemon-reload
sudo systemctl start nodebb
The configuration file is:
[Unit]
Description=NodeBB Service
After=system.slice multi-user.target
[Service]
User=YOUR_USER
Group=YOUR_USERGROUP
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodebb
Environment=NODE_ENV=production
WorkingDirectory=/var/nodebb
ExecStart=/usr/bin/node loader.js --no-daemon --no-silent
Restart=always
[Install]
Alias=forum
WantedBy=multi-user.target
You can read mode about systemctl
, that is the integrated Ubuntu service manager, read here