|
|
@ -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") |
|
|
|
}) |
|
|
|