An Interesting pid File Race
ISC’s dhcpd uses this code to check for an already-running daemon:
/* Read previous pid file. */
if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
status = read (i, pbuf, (sizeof pbuf)...
(Click through for full post...)