使用supervisord 来守护 nginx进程
supervisord 簡(jiǎn)介:
Supervisord 是用 Python 實(shí)現(xiàn)的一款的進(jìn)程管理工具,supervisord 要求管理的程序是非 daemon 程序,supervisord 會(huì)幫你把它轉(zhuǎn)成 daemon 程序,因此如果用 supervisord 來管理進(jìn)程,進(jìn)程需要以非daemon的方式啟動(dòng)。
例如:管理nginx 的話,必須在 nginx 的配置文件里添加一行設(shè)置 daemon off 讓 nginx 以非 daemon 方式啟動(dòng)。
安裝,配置過程 參考了 胡偉煌 Linux 學(xué)習(xí)筆記 非常詳細(xì),非常感謝
https://www.bookstack.cn/read/huweihuang-linux-notes/tools-supervisor-usage.md
另外其他資料上說 在編寫 supervisord 管理nginx的配置文件(就是supervisord 通過這個(gè)配置文件來啟動(dòng)nginx)上說,
nginx的啟動(dòng)命令 要加上 -g ‘daemon off;’ 但是我嘗試了之后,發(fā)現(xiàn)這樣并不能啟動(dòng)nginx, 我還是通過改變 nginx 自身的配置文件 比如:
/usr/local/nginx/conf/nginx.conf
另外 將 supervisord加入開機(jī)啟動(dòng)項(xiàng):
systemctl enable supervisord參考鏈接:https://blog.csdn.net/cxu123321/article/details/104766471/
總結(jié)
以上是生活随笔為你收集整理的使用supervisord 来守护 nginx进程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 成都大熊猫繁育研究基地驾照可以进园吗
- 下一篇: 英雄联盟(LOL)中英雄的防御属性是怎么