I would like to see the function of «nodebb-plugin-night-mode» in the community forum. :)
My take on the systemd unit for the Debian Jessie platform. Requires a
nodebb user set up and NodeBB installed to
[Unit] Description=NodeBB forum for Node.js. Documentation=http://nodebb.readthedocs.io/en/latest/ After=system.slice multi-user.target [Service] Type=simple User=nodebb 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
@vladius No problem -- though I fail to see how systemd is more readable than upstart ... then again that kind of stuff is beyond my area of expertise.
@julian no real upstart experience on my side. so far I love systemd. the syntax for config files, the status reports, the overall feel of the tech just seems right (and mainstream also).
i use init script on ubuntu to start on boot. and use that to stop and restart, reload, etc
Upstart. NGINX. BASH Scripts to help me with various tasks.
Another fun fact is that I am running more than one NodeBB instance.
@vladius I just upgraded my system to 16.04 and am liking systemd :) Does this script work when you stop the service too or do you just have to find the pid and kill it manually?
I have the same without
Type=simple and I start, stop and restart the service with
systemd start/stop/restart nodebb
@Giggiux I did try it out after posting and it seems that systemd can keep track of a running process' pid to know how to stop it... I don't know if it's the cleanest way but it works, since the loader pays attention to the SIGINT signal
If anyone comes across this topic again, I've created my own version of the systemd service file for NodeBB. It's really nice to have especially in scenarios where your VPS gets shut down for whatever reason; all you have to do is start the VM back up.
@Bri That's quite helpful, thanks! We might make use of this too :shipit: