Can't start NodeBB automatically after system reboot



  • Hi, My OS is CentOS 6.4 x64
    I add this script to /etc/rc.d/rc.local to start NodeBB automatically after system reboot.

    /etc/init.d/mongod start
    cd /var/nodebb
    /usr/local/node/bin/forever start /var/nodebb/app.js > /root/log
    /etc/init.d/nginx start
    

    I find that mongodb and nginx can start successfully, but nodebb isn't running. The log file is empty. I don't know what the problem is. Could you help me?


  • Plugin & Theme Dev

    @Hao-Lee said in Can't start NodeBB automatically after system reboot:

    but nodebb isn't running.

    hmm...... it's probably erroring....

    try this script instead:

    /etc/init.d/mongod start 
    cd /var/nodebb 
    /usr/local/node/bin/forever start /var/nodebb/app.js &> /root/log
    /etc/init.d/nginx start 
    

    it won't fix your issue, but it should log both stderr and stdout to your log file for debugging


  • Admin

    You'll probably want NodeBB to run in the foreground, and not pipe output to the log file, if you want to use forever or upstart.

    node loader.js --no-silent --no-daemon will run production mode and leave output piping to stdout. It will also run in the foreground, which forever expects.

    If you use app.js, you won't need --no-daemon, but you'll only be running one process.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.