Can't start NodeBB automatically after system reboot

General Discussion
  • 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?

  • @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

  • 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.

Suggested Topics

  • 1 Votes
    3 Posts

    The obvious clue bat here is that Flarum is based on PHP glue scripts. So you're always going to suffer that. No matter what. Mitigate? Sure. To various degrees. But yer' still sufferin'. NodeJS makes sense. Especially modern times. Warts? Indubitably. But as do all things. Take the good with the not so good.

    tl;dr?? NodeBB scales really, really, really well! 😜

    And is kinda' fun to work with. Cuz the devs are at the least, tolerable, and other times... pretty cool, even. 😎 🕶

    I would suggest you explore db backend options. In particular, MongoDB and PostgreSQL. Investigate scaling the system. Then ponder doing similarly w/Flarum. No contest fer' me. But, as w/all things, your mileage may vary....

    Have fun! 🐕 🌴 🌴

    Edit: P.S.; Asciidoc rules! Markdown drools!

  • 0 Votes
    1 Posts

    I am in beijing, and I can't access nodebb website or community without shadowsocks, I think maybe the China GFW block it. If nodebb need more people to use it. This problem should be solved, maybe build a mirror website?

  • Is NodeBB free?

    Solved General Discussion
    0 Votes
    7 Posts

    @Danny-McWilliams said:

    Is it free? Yes. The software is free.
    Is there also a hosted version where the hosting and technical side is done for you? Yes.

    If you "don't want to configure and do that annoying stuff" then you can either pay to have it hosted, or pay a third party to do it for you.

    If you don't want anyone to configure and host a server for you, or that "annoying stuff" like installing it and paying for a server of some description, you are never going to get it "for free".

    There's lots of guides on how to do it relatively cheaply, if you're willing to learn a little (it's not a lot) and maintain it (which isn't difficult).

    Hmm ill think about doing that.

  • 0 Votes
    14 Posts

    @djcyry Apache can work too with reverse proxy's if you feel more comfortable with that. Its also documented in the current NodeBB documentation. So long you host the 2 NodeBB forums on different ports it will work without any problems.

  • 0 Votes
    26 Posts

    @julian No. Not really sure what else I can do except to maybe rebuild the whole server. I'm just running the upstart script with ./nodebb start for now. IIRC, the major drawback to that was that it doesn't write the PID to a file and so you can't make an orderly stop to the process, which is not ideal, but it will work for me for now.