Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot get my Upstart script to run Node.js and Forever when server restarts
    primarykey
    data
    text
    <p>I've been setting up my server recently and today I had to restart it... then I realised all of my Node apps I had running weren't running anymore. I'm using Node Forever module to keep the apps running, but then I realised I still need to have them starting when my server restarts or shut downs and powers up again.</p> <p>I have been researching the best way to do this, but what I'm trying just doesn't seem to work. I've created an Upstart script in my <code>/etc/init/</code> folder on my Ubuntu Server 10.04LTS remote server and tried restarting and it doesn't seem to do anything. Nothing is getting listed when I run <code>forever list</code>.</p> <p>Here is my current Upstart script I was trying out today:</p> <pre><code>#/etc/init/myapp.conf start on (local-filesystems and net-device-up IFACE=eth0) stop on shutdown script exec sudo /usr/local/bin/node /var/www/myapp/myapp.forever.js end script </code></pre> <p>I use Forever in a Node script as I find it easier to configure it how I want. It's confirmed that the script runs just fine if I do this outside the script, there is just something wrong with the Upstart script itself. It seems to have the same permissions as all the other Upstart scripts in <code>/etc/init/</code> folder.</p> <p>As an additional note, I have gone through almost all the answers I could find here on StackOverflow, and that it how I got together the script that I have at present.</p> <p><strong>UPDATE:</strong></p> <p>With Tom's answer, I have now tried:</p> <pre><code>#/etc/init/myapp.conf start on (local-filesystems and net-device-up IFACE=eth0) stop on shutdown exec sudo /usr/local/bin/node /var/www/myapp/myapp.forever.js </code></pre> <p>But it's still not working.</p> <p>So I don't know why this isn't running when I restart my server. Please help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload