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

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";


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

only message in thread, other threads:[~2009-01-20 19:53 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:53 cluster: STABLE3 - [RGMANAGER] Resolves: #474444 - 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).