This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: STABLE3 - [RGMANAGER] Resolves: #474444 - Zero-length pidfiles cause resource start failures
- From: Marek GrÃc <marx at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 20 Jan 2009 19:52:54 +0000 (UTC)
- Subject: cluster: STABLE3 - [RGMANAGER] Resolves: #474444 - Zero-length pidfiles cause resource start failures
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=621578a82cb1e7cbeb8008f6c5b58becdffd92a8
Commit: 621578a82cb1e7cbeb8008f6c5b58becdffd92a8
Parent: ff9e3372ddca5cd7351f8fdc35e6bd65a3aff84e
Author: marx <marx@hroch.englab.brq.redhat.com>
AuthorDate: Tue Jan 20 20:17:06 2009 +0100
Committer: Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Tue Jan 20 20:52:20 2009 +0100
[RGMANAGER] Resolves: #474444 - Zero-length pid files cause resource start failures
---
rgmanager/src/resources/utils/config-utils.sh.in | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/utils/config-utils.sh.in b/rgmanager/src/resources/utils/config-utils.sh.in
index b5fcf84..4ee083f 100644
--- a/rgmanager/src/resources/utils/config-utils.sh.in
+++ b/rgmanager/src/resources/utils/config-utils.sh.in
@@ -218,6 +218,14 @@ check_pid_file() {
return 0;
fi
+ ## if PID file is empty then it should be safe to remove it
+ read pid < "$pid_file"
+ if [ -z "$pid" ]; then
+ rm $pid_file
+ ocf_log debug "PID File \"$pid_file\" Was Removed - Zero length";
+ return 0;
+ fi
+
if [ ! -d /proc/`cat "$pid_file"` ]; then
rm "$pid_file"
ocf_log debug "PID File \"$pid_file\" Was Removed - PID Does Not Exist";