Service file for running NodeBB with systemd. Drop or symlink into the /etc/systemd/system/ folder. This version uses node versions provided by nvm.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 | |
Environment=HOME=/usr/share/nginx/nodebb | |
Environment=PATH=/usr/share/nginx/nodebb/.nvm/versions/node/v4.8.5/bin:/usr/local/bin:/usr/bin:/bin | |
WorkingDirectory=/usr/share/nginx/nodebb/NodeBB/ | |
# Call with exec to be able to redirect output: http://stackoverflow.com/a/33036589/1827734 | |
ExecStart=/bin/bash -c 'exec /usr/share/nginx/nodebb/.nvm/versions/node/v4.8.5/bin/node /usr/share/nginx/nodebb/NodeBB/loader.js --no-daemon --no-silent 2>&1 | tee -a /usr/share/nginx/nodebb/NodeBB/logs/output.log' | |
Restart=on-failure | |
[Install] | |
Alias=forum | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a couple of questions about this: