當須要實現守護進程 , 以及本身開發的命令自動崩潰重啓時,可使用go版本的supervisord , 比python版本依賴少一些html
git clone https://github.com/ochinchina/supervisord.git
env GOOS=linux GOARCH=amd64 go build -o supervisord_linux_amd64 64位版本python
env GOOS=linux GOARCH=386 go build -o supervisord_linux_386 32位版本linux
配置命令git
vim supervisor.inigithub
[inet_http_server] port = :8082 [program:go-fly] directory = /var/www/html/go-fly/ command = ./main -port 8081
執行vim
./supervisord_linux_386 -c supervisor.ini -d測試
能夠看到go-fly的進程已經被啓動了, 而且kill掉之後會自動重啓ui
測試地址:server
https://gofly.sopans.com/indexhtm