Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 900 Bytes

README.md

File metadata and controls

49 lines (39 loc) · 900 Bytes

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())
	}
}