Search code examples
phplinuxcentos7phpwebsocket

How to start the websocket server automatically when it was stopped or server was rebooted after a long time


I am using the ratchet websocket server on CentOs. The problem is it is stopped after some time. I have used the screen command to solve the problem but when server is rebooted it does not start automatically. Is there any way to start the websocket server automatically when it was stopped or killed or server was restarted?


Solution

  • You can use supervisord for it. It can monitor and automatically start / restart processes.