[ovs-dev] [PATCH] ovs-lib.in:Add process name checking when start ovs service

Ben Pfaff blp at nicira.com
Fri Aug 1 01:13:29 UTC 2014


On Fri, Aug 01, 2014 at 01:09:31AM +0000, Lichunhe wrote:
> >-----Original Message-----
> >From: Ben Pfaff [mailto:blp at nicira.com]
> >Sent: Friday, August 01, 2014 8:19 AM
> >To: Lichunhe
> >Cc: dev at openvswitch.org; Qianhuibin (Huibin QIAN, Euler)
> >Subject: Re: [ovs-dev] [PATCH] ovs-lib.in:Add process name checking when start
> >ovs service
> >
> >On Wed, Jul 30, 2014 at 02:22:50PM +0800, lichunhe at huawei.com wrote:
> >> From: Chunhe Li <lichunhe at huawei.com>
> >>
> >> Only check wheather is daemon pid exist is not enough, becasue the pid
> >> which store in pidfile maybe assign to another process by OS. So it
> >> will checking failed for pid exist, but the starting process which own
> >> the pid is not the ovs daemon.
> >>
> >> Signed-off-by: Chunhe Li <lichunhe at huawei.com>
> >> Signed-off-by: wuyunfei <wuyunfei at huawei.com>
> >
> >Does this solve a problem you observed in practice?
> >
> >There are at least two other ways that one could verify that the pid is actually
> >the process we expect.  One is to look at /proc/$pid/comm or /proc/$pid/exe.
> >The other is to verify that the process holds the lock on the pidfile (which all OVS
> >daemons do).  These approaches might be more reliable than "pidof": instead
> >of checking that some process with the given name exists, they check attributes
> >of that particular process.
> >
> >What are your thoughts?
> 
> Yes, we use this patch solve a problem, and the scenario is that the server which runs the daemon 
> is cold reset, the "pidfile" is not cleared. When the server starts, the left $pid which stores in "pidfile"
> has been assigned to "ovs_workq" kernel process, and then the ovs-vswitchd starts to check the $pid,
> finds it exist and exit.
> 
> These approaches which you list are better than my provided. Do you want me to send another patch?
> Or you could do it yourself.

I'd prefer to receive another patch.


More information about the dev mailing list