On Fri, Aug 01, 2014 at 01:09:31AM +0000, Lichunhe wrote: > >-----Original Message----- > >From: Ben Pfaff [mailto:b...@nicira.com] > >Sent: Friday, August 01, 2014 8:19 AM > >To: Lichunhe > >Cc: dev@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, lichu...@huawei.com wrote: > >> From: Chunhe Li <lichu...@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 <lichu...@huawei.com> > >> Signed-off-by: wuyunfei <wuyun...@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. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev