god

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2018 License: MIT Imports: 13 Imported by: 0

README

god

Keep an eye on some process running. God will restart your program if it exits unexpected. This is helpful when you don't have time 24/7 to watch over your applications. It restarts program on SIGHUP, graceful restart on SIGUSR2 and forward SIGUSR1.

Be aware this may not work well if your program forks another process, special in watch mode.

Usage

build
go build
run
>> ./god --pidfile god.pid -s go run test_program/test_bin.go
Check test_bin.go working
//Open in browser
http://127.0.0.1:8080/
run in watch mode, for a go program, ie don't run "go run"
>> ./god --watch folder1,folder2 --watch-exts go,json --pidfile god.pid -s make build-go-program
>> ./god --watch touchfolder --watch-exts touch --pidfile god2.pid -s /path/to/go-program
restart
>> kill -s HUP $(cat god.pid)
>> kill -s USR2 $(cat god.pid)
stop
>> kill $(cat god.pid)

Documentation

Overview

Package god is for starting worker processes and keep an eye on them

> go build

> god --pidfile god.pid -s sleep 5

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL