Autostarting loader.js



  • Hi,

    I'm usually starting my nodebb forum by switching into the nodebb dir and then do:

    sudo node ./loader start

    works, but doesn't start when the system is rebooting. I tried to add the command to to a scriptfile and exec it in /etc/xdg/autostart/ But then I found out that using the whole path of loader.js doesn't work. so ie:

    sudo node /var/www/mynodebb/loader start doesn't work but changing into the mynodebb dir and type

    sudo node ./loader start

    works... Can somebody explain me what I'm doing wrong?

    thanks & regards
    Flo



  • Had the same problem. What keeps you from just using
    cd /var/www/mynodebb/ && sudo ./nodebb start?



  • The fact that I'm too f00lish to know that I can use a command chain by && ^^ will try


  • GNU/Linux Admin

    Just some thoughts: NodeBB does not need root permissions to run, unless you are listening directly on a port lower than 1024.

    Secondly, yeah, try switching current directory before running ./nodebb start



  • So I tried the command cd /var/www/mynodebb/ && sudo ./nodebb start and it worked manually like a charme but when I try to auto start this as a script it still fails, here is what I did (running ubuntu 14.04 lts @ ec2 instance):

    1. sudo vi /usr/local/bin/autostart.sh
    #!/bin/sh
    cd /var/www/mynodebb && sudo ./nodebb start
    
    1. sudo chmod 4755 autostart.sh

    2. sudo vi /etc/xdg/autostart/vmware-user.desktop

    [Desktop Entry]
    Type=Application
    Encoding=UTF-8
    Exec=/usr/bin/vmware-user-suid-wrapper
    Name=VMware User Agent
    # KDE bug 190522: KDE does not autostart items with NoDisplay=true...
    # NoDisplay=true
    X-KDE-autostart-phase=1
    exec=/usr/local/bin/autostart.sh
    

    doesn't work... but as I' reading this I might guess that it doesn't work because I don't load any "Desktop" or GUI!? I use this method because of the autostart wiki of ubuntu


Log in to reply
 

Suggested Topics

| |