[go] go language practice – supervisor compilation, installation and operation of go version


When the daemon needs to be implemented and the self-developed command automatically crashes and restarts, you can use the go version of supervisor, which is less dependent than the python version

git clone https://github.com/ochinchina/supervisord.git
env GOOS=linux GOARCH=amd64 go build -o supervisord_ linux_ amd64   64 bit version

env GOOS=linux GOARCH=386 go build -o supervisord_ linux_ three hundred and eighty-six   32-bit version

Configuration command

vim supervisor.ini

port = :8082

directory = /var/www/html/go-fly/
command = ./main -port 8081



./supervisord_linux_386 -c supervisor.ini -d

You can see that the go fly process has been started and will restart automatically after killing

Test address: