httpapi: don't create a pidfile if it isn't set in the configuration

Upstream-commit: 7b17d555992c65c6b10da21c8aa48062a1aba0d9
Component: engine
This commit is contained in:
Solomon Hykes
2013-10-27 06:51:43 +00:00
parent 26507356b3
commit 6d10998928

View File

@ -44,8 +44,11 @@ func jobInitApi(job *engine.Job) string {
if err != nil {
return err.Error()
}
if err := utils.CreatePidFile(srv.runtime.config.Pidfile); err != nil {
log.Fatal(err)
if srv.runtime.config.Pidfile != "" {
job.Logf("Creating pidfile")
if err := utils.CreatePidFile(srv.runtime.config.Pidfile); err != nil {
log.Fatal(err)
}
}
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))