Upstart & node.js app "stop: Unknown instance:"

I am having problems with upstart on ubuntu and node.js.

Everything worked fine with the upstart script. Start, stop, status, etc. Everything worked as expected until I deployed the new code. Changes were not reflected in the running application. I assumed that somehow the new code was not loaded by stop ing and start application.

I followed the kill guide on the pid of a running daemon in which I believe that I was wrong.

Currently, if I am an initctl list , I see my application in the list:

 mynodejs.app stop/waiting 

When I start mynodejs.app , it seems to start:

 mynodejs.app start/running, process 16228 

But when you try to stop it:

 stop: Unknown instance: 

A...

 status mynodejs.app mynodejs.app stop/waiting 

... although the application is up and running.

+4
source share
2 answers

I will answer my question ...

Restarting the init process cleared everything.

 sudo /sbin/telinit q 

I needed to kill a fraud instance of my application. After that, using start and stop worked as expected.

+8
source

Using automatic monitoring -> reboot, can solve this problem. The monit setup for this is described in howtonode.org , but more efficiently here . The comments for the howtonode.org guide, which I found very useful for a different approach to configuring Ubuntu with Upstart, alas, is inclusion in this post.

+1
source

Source: https://habr.com/ru/post/1400669/


All Articles