Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 comment

1 Answer

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

respawn

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
add comment

Your Answer

 
discard

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.