we are working on project where we have used node-js in background socket for continues respond to web application. In between sometimes somehow some process stops automatically.
We would like to know how we can check all the process running using forever.
We are using sudo forever list to list all process. Is there any way to use this command(forever list) in .sh(shell script file) to check my specific process like responsclient is working or not. If that particular process is not working then we needs to start that.
There are several solutions that will ensure that your service is always running.
One of them is even called forever. Here you have an overview prepared by express.
However, for production services I recommend passenger The result is almost the same, but much greater scalability. For example, you can configure so that another instance is automatically added.
Almost - because it is designed to ensure the availability of HTTP, and not the constant operation of the application.
BTW: service stops, because you have uncatched exception.
If you insist on forever, then: (We're talking about the same forever?)
forever is run by the same user. forever has separate managers for all users.cron is different from manual startup (vaiables in env))forever has --pidFile - then it is very easy to check if the process is workingps -aux | grep node should be your big friend.No, I do not have it combined. When I started to have problems, I switched to passenger. Finally I did it well because I have professional monitoring, which I launched in less time than searching how to combine the above points together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With