[svlug] Reuse of pid's.

Greg Lindahl lindahl at pbm.com
Wed Jan 21 11:59:35 PST 2009


On Wed, Jan 21, 2009 at 11:20:12AM -0800, Don Marti wrote:

> Not really, since you don't know what pid the kernel
> will give the next process it creates.

'cept they're traditionally handed out round-robin, which is why
killall works most of the time. It's only when you have a very fast
rate of process creation that you get into trouble.

> If you absolutely need to be sure you're talking to
> the right process, could you have it write its pid
> to a file, or use a socket?

This is good advice, when you can do it. Many uses of killall can't
use this technique. In the init.d on my current system (CentOS 5.2)
all of the uses of killall are ones that can't use a file or socket.

-- greg






More information about the svlug mailing list