[lvm-devel] [PATCH] check for running cluster log daemon, not just log module

Alasdair G Kergon agk at redhat.com
Mon Jul 19 21:00:07 UTC 2010


The function is named 'daemon_is_running', so it really should
still give the correct answer if the daemon is *not* running
but a previous instance left the file behind for any reason.
I.e. validate that the PID in the file does in fact still
exist and have that lockfile open.

>> Yes - check /proc/<pid>/fd/*  if available?

Read pidfile to get PID.

List /proc/<pid>/fd/* and check that one of them (a quick code
audit might even enable you to guarantee which one and pass it
in as another parameter) points back at the file.

The daemon name doesn't really matter in this: if someone creates other
software that uses *our* lockfile then they've got bigger problems, but yes,
you could pass that in and check that too.

Alasdair




More information about the lvm-devel mailing list