Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an upstart script which runs a node.js deamon continuously.

What I'm trying to do is to restart this daemon when/if it fails.

I have little or no idea how to go about this.

Any insight greatly appreciated,

share|improve this question
I've just discovered forever (sudo npm install forever) – Eamorr Jul 14 '12 at 16:22

Add the following line to the end of your upstart script:


That's exactly for the case you described: Upstart then watches it and starts it as soon it is "exiting" -- with just one exception: If it is intentionally stopped by service xyz stop it will be stopped and not respawn until it is intentionally started again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.