[Linux-cluster] trivial fix

Marek Grac mgrac at redhat.com
Mon Feb 15 15:45:34 UTC 2010


On 02/03/2010 01:23 PM, Kaloyan Kovachev wrote:
> Hi,
>   if the pid file contains more than 1 line (like sendmail) the
> status_check_pid function returns an error. The attached patch replaces it with
> 'read pid' like it is done for stop_generic
>    
>
>
> --
> Linux-cluster mailing list
> Linux-cluster at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-cluster
Hi, thanks for a patch. I just added a test for empty pid file. Feel 
free to test it, I will add it in main tree in few days.

m,


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-cluster/attachments/20100215/29c45b8d/attachment.htm>


More information about the Linux-cluster mailing list