go-supervisord icon indicating copy to clipboard operation
go-supervisord copied to clipboard

RPC remote control for supervisord

go-supervisord

RPC remote control for supervisord

GoDoc

Code Examples

Reloading configuration and clearing daemon log:

import "github.com/abrander/go-supervisord"
  
func main() {
	c, err := supervisord.NewClient("http://127.0.0.1:9001/RPC2")
	if err != nil {
		panic(err.Error())
	}
	
	err = c.ClearLog()
	if err != nil {
		panic(err.Error())
	}
	
	err = c.Restart()
	if err != nil {
		panic(err.Error())
	}
}

Stop supervisord process worker:

import "github.com/abrander/go-supervisord"
  
func main() {
	c, err := supervisord.NewClient("http://127.0.0.1:9001/RPC2")
	if err != nil {
		panic(err.Error())
	}
	
	err = c.StopProcess("worker", false)
	if err != nil {
		panic(err.Error())
	}
}