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

Time:2021-10-21

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

[inet_http_server]
port = :8082

[program:go-fly]
directory = /var/www/html/go-fly/
command = ./main -port 8081

  

implement

./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:

https://gofly.sopans.com/index