Re: enbd 2.4.32/kernel 2.6.12.3 pid file problem

"Peter T. Breuer" <[email protected]>
Newsgroups gmane.linux.enbd.general
Organization Area Telematica, Universidad Carlos III, Madrid, Spain
Message-ID <[email protected]>
In article <[email protected]> you wrote:
> myckpidfile(struct nbd_pidfile * self) {
> 
>      int otherpid;
>      int mypid = getpid();
>      int myppid = getppid();
> 
>      sleep(2);
>     ^^^^^^^^^

Thinking about it, I don't think it is racing with itself.  All I can
imagine is that you are starting it with some generic daemon starter
that writes its own pid in the pidfile, and which hangs around just long
enough to see the parent of this daemon process die (after it has
launched its daemon child).

That would mean that the extra 2s wait would allow the parent (which
nowadays runs second after a fork) to die off, the daemon launcher to
die, and this process to see a pid entry that corresponds to no known
live process, which can hence be overwritten.

So .. how are you starting the enbd-client?

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.