public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL4 - [RGMANAGER] Resolves: #480828 - Zero-length pid files cause resource start failures
@ 2009-01-20 19:24 Marek Grác
  0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-01-20 19:24 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0a34ebbbd5abdde5688ec2266382326dffacef14
Commit:        0a34ebbbd5abdde5688ec2266382326dffacef14
Parent:        a42cdd513637c80573fe883d5dc9ec9c207f9f1e
Author:        marx <marx@hroch.englab.brq.redhat.com>
AuthorDate:    Tue Jan 20 20:17:06 2009 +0100
Committer:     marx <marx@hroch.englab.brq.redhat.com>
CommitterDate: Tue Jan 20 20:17:06 2009 +0100

[RGMANAGER] Resolves: #480828 - Zero-length pid files cause resource start failures

---
 rgmanager/src/resources/utils/config-utils.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/resources/utils/config-utils.sh b/rgmanager/src/resources/utils/config-utils.sh
index fd79d6e..67049c7 100644
--- a/rgmanager/src/resources/utils/config-utils.sh
+++ b/rgmanager/src/resources/utils/config-utils.sh
@@ -289,6 +289,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";


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-20 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-20 19:24 cluster: RHEL4 - [RGMANAGER] Resolves: #480828 - Zero-length pid files cause resource start failures Marek Grác

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).