Re: [ovs-dev] [daemon 10/10] daemon: Avoid races on pidfile creation.

2011-04-04 Thread Ben Pfaff
On Fri, Apr 01, 2011 at 05:13:19PM -0700, Ethan Jackson wrote: > > + ? ?/* Rename or link it to the ocrrect name. */ > > + ? ?if (overwrite_pidfile) { > > + ? ? ? ?if (rename(tmpfile, pidfile) < 0) { > > + ? ? ? ? ? ?VLOG_FATAL("failed to rename \"%s\" to \"%s\" (%s)", > > + ? ? ? ? ? ? ? ? ? ? ? t

Re: [ovs-dev] [daemon 10/10] daemon: Avoid races on pidfile creation.

2011-04-01 Thread Ethan Jackson
> +    /* Rename or link it to the ocrrect name. */ > +    if (overwrite_pidfile) { > +        if (rename(tmpfile, pidfile) < 0) { > +            VLOG_FATAL("failed to rename \"%s\" to \"%s\" (%s)", > +                       tmpfile, pidfile, strerror(errno)); > +        } typo in the comment. Lo

Re: [ovs-dev] [daemon 10/10] daemon: Avoid races on pidfile creation.

2011-04-01 Thread Justin Petbot
On Thu, 31 Mar 2011, at 4:31:33 PM, Ben Pfaff wrote: > Until now, if two copies of one OVS daemon started up at the same time, > then due to races in pidfile creation it was possible for both of them to > start successfully, instead of just one. This was made worse when a > previous copy of the da

[ovs-dev] [daemon 10/10] daemon: Avoid races on pidfile creation.

2011-03-31 Thread Ben Pfaff
Until now, if two copies of one OVS daemon started up at the same time, then due to races in pidfile creation it was possible for both of them to start successfully, instead of just one. This was made worse when a previous copy of the daemon had died abruptly, leaving a stale pidfile. This commit