docker daemon: initialize the daemon pidfile early

fixes https://github.com/dotcloud/docker/issues/6973

This way there are no races on iptables, etc. before there is a discovery of existing daemon pidfile

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
k. I'll look into that. I just copy pasted. Does engine Err status allow a
message included?
On Jul 11, 2014 4:14 PM, "Michael Crosby" <notifications@github.com> wrote:

> In server/server.go:
>
> > @@ -72,6 +72,17 @@ func (srv *Server) handlerWrap(h engine.Handler) engine.Handler {
> >  	}
> >  }
> >
> > +func InitPidfile(job *engine.Job) engine.Status {
> > +	if pidfile := job.Getenv("Pidfile"); pidfile != "" {
> > +		job.Logf("Creating pidfile")
> > +		if err := utils.CreatePidFile(pidfile); err != nil {
> > +			// FIXME: do we need fatal here instead of returning a job error?
> > +			log.Fatal(err)
>
> You should just return the error here and no log.Fatal
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dotcloud/docker/pull/6976/files#r14841346>.
>