後臺啓動的php守護進程時 文件內include的代碼變動並未生效,須要重啓進程,咱們能夠更新代碼後手動重啓。可是有些對失效要求較高。那就須要自動重啓了。下面整理出三個方案用以實現。php
1 inotify-toolsweb
yum install inotify-tools
或者segmentfault
cp www/htdocs/cronservice/code/inotify-tools-3.14.tar.gz /usr/local/webserver/ cd /usr/local/webserver/ tar xvzf inotify-tools-3.14.tar.gz cd inotify-tools-3.14 ./configure --prefix=/usr/local/webserver/inotify-tools make && make install
參考文章:bash
https://segmentfault.com/q/1010000018623406swoole
https://blog.51cto.com/kexiaoke/2118813code
2server
swoole workerStart方式blog
3進程
workerman reload機制class