Question

I'm having a bit of trouble with upstart on ubuntu and a node.js app.

Everything was working fine with the upstart script. Start, stopping, status-ing, etc all worked as expected until I deployed new code. The changes weren't reflected in the running app. I reasoned that somehow the new code wasn't being loaded by stoping & starting the app.

I did a manual kill on the pid of the running daemon which is where I believe I went awry.

At the present moment, If I initctl list I see my app in the list:

mynodejs.app stop/waiting

When I start mynodejs.app it seems to start:

mynodejs.app start/running, process 16228

But, when try to stop it:

stop: Unknown instance:

And...

status mynodejs.app
mynodejs.app stop/waiting

...although the app is up and running.

Was it helpful?

Solution

I'll answer my own question...

Restarting the init process cleared everything up.

sudo /sbin/telinit q

I needed to kill the rogue instance of my app. After that, using start and stop worked as expected.

OTHER TIPS

Using automatic monitoring -> restart, can resolve this issue. Setting up monit to do so is described on howtonode.org, yet more effectively here. The comments for the howtonode.org guide I found very useful for other's approach towards setting up Ubuntu with Upstart, alas it's inclusion in this post.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top