[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]