You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
mr c0b e83b21e373
loop reaping dead children
7 years ago
Godeps change to vfs instead of gobindata 7 years ago
docs add gif page 8 years ago
gops use ps command to collect cpu and memory 8 years ago
hipchat add hipchat lib 8 years ago
pushover add pushover, it seems blocked in china 8 years ago
res format code 7 years ago
vendor change to vfs instead of gobindata 7 years ago
.fsw.yml try to fix branch, but log still duplicate 8 years ago
.gitignore change to vfs instead of gobindata 7 years ago
.gopack.yml auto generate version from git, close #11 8 years ago
.travis.yml update travis doc 7 years ago
LICENSE Initial commit 9 years ago
README.md update travis doc 7 years ago
README_ZH.md update zh readme 8 years ago
assets_dev.go user can not switch .. 7 years ago
assets_generate.go user can not switch .. 7 years ago
broadcast.go remove useless file 8 years ago
broadcast_test.go quick fix broadast test 8 years ago
build.sh update self [[DDsupport channel 8 years ago
build_remote.sh update build script 7 years ago
build_standalone.sh update build script 7 years ago
cmds.go update code structure 7 years ago
config.go add config.yml file 8 years ago
deploy.sh update travis doc 7 years ago
equinox.key.enc add travis equinox.io support 8 years ago
equinox.pub add equinox self update support 8 years ago
fsm.go user can not switch .. 7 years ago
fsm_test.go add stop timeout setting, add fsm_test.go 8 years ago
gosuv.go update code structure 7 years ago
res_bindata.go user can not switch .. 7 years ago
sigchld_unix.go loop reaping dead children 7 years ago
utils.go prepare to write new broadcast 8 years ago
web.go change to vfs instead of gobindata 7 years ago

README.md

gosuv

Build Status

中文README 不是很全,能看懂英文的还是尽量看英文

current is in beta

Process management writtern by golang, inspired by python-supervisor

So why write another supervisor?

I have been using python-supervisor for many years and there are something uncomfortable feelings.

  1. Log can't contains ANSI color chars
  2. The configuration file can add on the web, often forgot some settings.
  3. supervisorctl reload will cause supervisord restarted
  4. Hard to set status change to fatal notifications.
  5. No process performance monitor page.
  6. Program starts with no common environ, eg, missing HOME and USER variable
  7. Kill process default is not group kill which make sub process still running.
  8. More... will added when I think of it.

Features

  • Web control page

  • HTTP Basic auth

  • Github webhook

  • Single log page, include search support

  • 中文文档

Requirements

Go version at least 1.6+

Installation

Standalone binary can be download from one of the following addresses

Branch Source Address
latest equinox https://dl.equinox.io/shengxiang/gosuv/stable

Or if you have go enviroment, you can also build from source.

go get -d github.com/codeskyblue/gosuv
cd $GOPATH/src/github.com/codeskyblue/gosuv
go build

If you want to build a standalone binary, run the following command.

go generate
go build -tags vfs

Quick start

After you installed gosuv, the first thing is to start server.

gosuv start-server

Show server status

$ gosuv status
Server is running

Open web http://localhost:11313 to see the manager page. And follow the gif to add a program to gosuv.

gosuv web

Configuration

Default config file stored in directory $HOME/.gosuv/, Set env-var GOSUV_HOME_DIR can change config file store directory.

  • file programs.yml contains all program settings.
  • file config.yml contains server config

File config.yml can be generated by gosuv conftest

Example config.yaml

server:
  httpauth:
    enabled: false
    username: uu
    password: pp
  addr: :11313
client:
  server_url: http://localhost:11313

Logs can be found in $HOME/.gosuv/log/

Edit config file(default located in $HOME/.gosuv/programs.yml) and run gosuv reload will take effect immediately.

Design

HTTP is follow the RESTFul guide.

Get or Update program

<GET|PUT> /api/programs/:name

Add new program

POST /api/programs

Del program

DELETE /api/programs/:name

State

Only 4 states. ref

states

Notification

Configuration example

- demo-program:
  command: ...
  notifications:
    pushover:
      api_key: [token]
      users:
      - [user1]
      - [user2]

Now only support pushover, and only status change to fatal will get notified.

Integrate with github (todo)

This is feature that will helps update your deployment environment once your updated in the github.

This part is set in the programs.yml, take look the example

- demo-program:
  command: python app.py
  directory: /opt/demo
  webhook:
    github:
      secret: 123456
      command: git pull origin master

LICENSE

MIT