سؤال

Sometimes my socket.io server crashes. Until I find a solution I want to automatically restart it. Is it possible to create a crontab or something (linux) which checks every 10 seconds if the server is still running and if not starts it?

Thanks!

هل كانت مفيدة؟

المحلول

I'd say it will be easier to just use forever

$ [sudo] npm install forever -g

you may have to daemonize it though... google according to your OS.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top