Re: trivial fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx 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     

--
Linux-cluster mailing list
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster

[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux