LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: ldirectord stop doesnt not work on free bsd

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: ldirectord stop doesnt not work on free bsd
From: Ramprasad A Padmanabhan <ramprasad@xxxxxxxxxxxxx>
Date: Mon, 19 Sep 2005 17:29:11 +0530
I got the bug.
The ldirectord looks for the pid directory under /proc
My free bsd machine does not have /proc at all

So I changed the script suitably. I hope the ldirectord developers would
look at a more genereic alternative to find out live pids than /proc

Thanks
Ram

-------- This is the change I have done -------------------

--- /tmp/ldirectord/linux-ha/ldirectord/ldirectord      Wed Sep  7
13:01:23 2005
+++ ldirectord  Mon Sep 19 17:26:42 2005
@@ -543,13 +543,8 @@
                $filepid = $_;
                close(FILE);
                # Check to make sure this isn't a stale pid file
-               if (open(FILE, "</proc/$filepid/cmdline")) {
-                       $_ = <FILE>;
-                       if (/ldirectord/) {
-                               $oldpid = $filepid;
-                       }
-                       close(FILE);
-               }
+               `kill -0 $filepid 2>/dev/null`;
+               $oldpid = $filepid if(0 == int($?));
        }
        if (defined $oldpid) {
                if ($CMD eq "start") {


--------------------


<Prev in Thread] Current Thread [Next in Thread>