Ubuntu 14.04 autostartup
-
Hey
I am trying to configure an autostartup for my nodebb when a reboot has been done, I've tried everything that is posted on https://community.nodebb.org/topic/4693/is-it-possible-to-auto-start-nodebb-in-the-startup-of-the-server/3
plus several other things I found online.
Anyone has any ideas on how to make this work? It doesn't seem to autostart on startup even after having the same things on sysv-rc-conf with e.g nginx that has autostartup.
Thanks
-
Easiest way is to install supervisor and create a new config file in /etc/supervisor/conf.d.
Lets name ours nodebb.conf:
[program:nodebb]
command = node /PATH/TO/NODEBB/app.js
directory = /PATH/TO/NODEBB/
user = YOURUSERNAME (You can also use root, otherwise it is extremely insecure!!!)
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/nodebb.log
stderr_logfile = /var/log/supervisor/nodebb_err.log -
conf.d
? How cuteHere's a config with Upstart:
start on startup stop on runlevel [016] respawn env HOME=/home/someuser script cd /home/someuser/nodebb node loader.js --no-silent --no-daemon end script
--no-silent
and--no-daemon
are required for upstart to function properly, as it relies on the process to not be daemonised. The former flag tells NodeBB to not use the log, and send everything to stdout, so upstart can catch it.Log file by default:
/var/log/upstart/nodebb.log
-
@julian I've never been able to get upstart to work