1. 程式人生 > >supervisor 使用遇到的問題及解決方案

supervisor 使用遇到的問題及解決方案

伺服器重新啟動後,需要將上面的服務也都跑起來,我們的一個 Node.js 的專案是用 supervisor 來管理的,首先啟動 supervisor,可是,,卻報出瞭如下錯誤:

unix:///tmp/supervisor.sock refused connection
對於這個問題,以下文章給出了很好的解決辦法:

http://www.cashqian.net/blog/001472975510127673ea63db9234c4e8293cf43cefcafde000

去 /tmp 下檢視,果然沒有 supervisor.sock 檔案,原來,tmp 是快取目錄,linux 會選擇性刪除這裡的檔案,我就在這裡又建立了一下這個檔案

再次啟動 supervisor 用報錯了:

supervisor error (no such process)
supervisor cant find command npm

它竟然不認識 npm 了,繼續找原因發現這個好文章:https://ma.ttias.be/supervisor-job-spawnerr-cant-find-command-something/
The tool I wanted to run wasn't in supervisor's $PATH though.
就是這個原因,supervisor才不認識它,那麼就把命令的全路徑寫上好了~~

至此,問題解決。