diff --git a/.gitignore b/.gitignore index c74436ef2..760c8cf71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.swp *.swo .bak +*.bak .DS_Store build/* rpc/test/.tendermint diff --git a/binary/README.md b/binary/README.md index 2dfa79192..c490d0e57 100644 --- a/binary/README.md +++ b/binary/README.md @@ -3,6 +3,8 @@ This documentation is out of date. * 0x00 is reserved as a nil byte for RegisterInterface * moved TypeByte() into RegisterInterface/ConcreteType +* Pointers that don't have a declared TypeByte() are + encoded with a leading 0x00 (nil) or 0x01. # `tendermint/binary` diff --git a/cmd/barak/main.go b/cmd/barak/main.go index 554e2242f..e270c3b77 100644 --- a/cmd/barak/main.go +++ b/cmd/barak/main.go @@ -88,12 +88,6 @@ func main() { } barak.registries = options.Registries - // Write pid to file. - err = AtomicWriteFile(barak.rootDir+"/pidfile", []byte(Fmt("%v", barak.pid))) - if err != nil { - panic(Fmt("Error writing pidfile: %v", err)) - } - // Debug. fmt.Printf("Options: %v\n", options) fmt.Printf("Barak: %v\n", barak) @@ -119,6 +113,12 @@ func main() { }(registry) } + // Write pid to file. This should be the last thing before TrapSignal. + err = AtomicWriteFile(barak.rootDir+"/pidfile", []byte(Fmt("%v", barak.pid))) + if err != nil { + panic(Fmt("Error writing pidfile: %v", err)) + } + TrapSignal(func() { fmt.Println("Barak shutting down") }) diff --git a/cmd/debora/main.go b/cmd/debora/main.go index fe109dd3b..51e7360df 100644 --- a/cmd/debora/main.go +++ b/cmd/debora/main.go @@ -32,6 +32,11 @@ func main() { Value: "default", Usage: "uses ~/.debora/.cfg", } + labelFlag = cli.StringFlag{ + Name: "label", + Value: "_", + Usage: "label of the process, or _ by default", + } bgFlag = cli.BoolFlag{ Name: "bg", Usage: "if set, runs as a background daemon", @@ -68,6 +73,7 @@ func main() { Usage: "run process", Action: cliRunProcess, Flags: []cli.Flag{ + labelFlag, bgFlag, inputFlag, }, @@ -125,15 +131,14 @@ func cliGetStatus(c *cli.Context) { func cliRunProcess(c *cli.Context) { args := c.Args() - if len(args) < 2 { - Exit("Must specify