For consistency the request actions are renamed to:
SANLK_REQ_SIGKILL: sigkill the process holding the resource lease.
SANLK_REQ_RELEASE: gracefully release the lease sending SIGUSR1 to
the process holding the resource lease.
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
src/resource.c | 4 ++--
src/sanlock.8 | 4 ++--
src/sanlock_resource.h | 14 ++++++++++----
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/resource.c b/src/resource.c
index 2a60a16..6c02107 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -856,11 +856,11 @@ static void do_request(struct token *tt, int pid, uint32_t
force_mode)
memset(&hm, 0, sizeof(hm));
- if (force_mode == SANLK_REQ_KILL_PID) {
+ if (force_mode == SANLK_REQ_SIGKILL) {
hm.type = HELPER_MSG_KILLPID;
hm.pid = pid;
hm.sig = (flags & R_RESTRICT_SIGKILL) ? SIGTERM : SIGKILL;
- } else if (force_mode == SANLK_REQ_SIGUSR1) {
+ } else if (force_mode == SANLK_REQ_RELEASE) {
hm.type = HELPER_MSG_KILLPID;
hm.pid = pid;
hm.sig = SIGUSR1;
diff --git a/src/sanlock.8 b/src/sanlock.8
index a23e54a..ea188f6 100644
--- a/src/sanlock.8
+++ b/src/sanlock.8
@@ -515,12 +515,12 @@ set in A's bitmap for request_finish_seconds.)
\fIforce_mode\fP determines the action the resource lease owner should
take:
-\fB1\fP (KILL_PID): kill the process holding the resource lease. When the
+\fB1\fP (SIGKILL): kill the process holding the resource lease. When the
process has exited, the resource lease will be released, and can then be
acquired by anyone. The kill signal is SIGKILL (or SIGTERM if SIGKILL
is restricted.)
-\fB2\fP (SIGUSR1): send SIGUSR1 to the process holding the resource lease.
+\fB2\fP (RELEASE): send SIGUSR1 to the process holding the resource lease.
\fB3\fP (KILLPATH): run the program configured by sanlock_killpath
against the process holding the resource lease.
diff --git a/src/sanlock_resource.h b/src/sanlock_resource.h
index f68fc3e..4969b65 100644
--- a/src/sanlock_resource.h
+++ b/src/sanlock_resource.h
@@ -33,15 +33,21 @@
/*
* request force_mode
- * SANLK_REQ_KILL_PID: send SIGKILL to pid holding the resource, or
- * SIGTERM if SIGKILL is restricted
- * SANLK_REQ_SIGUSR1: send SIGUSR1 to pid holding the resource
+ * SANLK_REQ_SIGKILL: send SIGKILL to pid holding the resource, or
+ * SIGTERM if SIGKILL is restricted
+ * SANLK_REQ_RELEASE: send SIGUSR1 to pid holding the resource
* SANLK_REQ_KILLPATH: run configured killpath against the pid
*/
+#define SANLK_REQ_SIGKILL 0x00000001
+#define SANLK_REQ_RELEASE 0x00000002
+#define SANLK_REQ_KILLPATH 0x00000003
+
+/*
+ * kept for backward compatibility
+ */
#define SANLK_REQ_KILL_PID 0x00000001
#define SANLK_REQ_SIGUSR1 0x00000002
-#define SANLK_REQ_KILLPATH 0x00000003
int sanlock_register(void);
--
1.7.1