Gitweb:
http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: e4eece4a2210e7dcd59a8fbc087d5992bc8808b1
Parent: 1004e18909a4a9039de835ee29034ecf42b6157d
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Feb 17 12:23:07 2010 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Feb 17 12:23:07 2010 +0100
resource agents: Handle multiline pid files
if the pid file contains more than 1 line (like sendmail) the
status_check_pid function returns an error.
Patch by Kaloyan Kovachev
---
rgmanager/src/resources/utils/ra-skelet.sh | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/utils/ra-skelet.sh
b/rgmanager/src/resources/utils/ra-skelet.sh
index e892656..5baaaa9 100644
--- a/rgmanager/src/resources/utils/ra-skelet.sh
+++ b/rgmanager/src/resources/utils/ra-skelet.sh
@@ -14,7 +14,13 @@ status_check_pid()
return $OCF_ERR_GENERIC
fi
- if [ ! -d /proc/`cat "$pid_file"` ]; then
+ read pid < "$pid_file"
+
+ if [ -z "$pid" ]; then
+ return $OCF_ERR_GENERIC
+ fi
+
+ if [ ! -d /proc/$pid ]; then
return $OCF_ERR_GENERIC
fi