> Someone suggested using fcntl to create a lock and then use fcntl again
> to see who holds the lock. That sounded good at first, but fork() does
> not seem to inherit locks. Does anyone have another idea?
Take a look at fghack (http://cr.yp.to/daemontools/fghack.html). It
opens a pipe, gives the write end to the daemon (but the daemon is not
aware of that) and monitors the read end. When the daemon process
exits, the read end of the pipe gets EOF.
If the daemon closes all filehandles, you're out of luck.
Eric
-- Eric Lammerts <eric@lammerts.org> | The best way to accelerate a computer http://www.lammerts.org | running Windows is at 9.8 m/s^2.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/