Hi,

I stumbled upon a bug in agent Xinetd after upgrading to 3.9.3.

The problem is with this command

ps -e -o pid,command | $AWK '$2 ~ /\/[x]inetd/ { print $1 }'

On Centos 5.9 it doesn't determine pid of the running xinetd process

# ps -e -o pid,command | grep xinetd
 4302 xinetd -stayalive -pidfile /var/run/xinetd.pid

First of all, I think comm option should be used instead of command:

# ps -e -o pid,comm | grep xinetd
 4302 xinetd


I ended up with the following fix :

diff --git a/heartbeat/Xinetd b/heartbeat/Xinetd
index 957a379..637077f 100755
--- a/heartbeat/Xinetd
+++ b/heartbeat/Xinetd
@@ -79,7 +79,7 @@ END
 hup_inetd () {
     # don't rely on the pid file, but lookup xinetd in the list of
     # processes
-    pid=`ps -e -o pid,command | $AWK '$2 ~ /\/[x]inetd/ { print $1 }'`
+    pid=`ps -e -o pid,comm | $AWK '$2 ~ /[x]inetd/ { print $1 }'`
     if [ "$pid" ]; then
        if kill -s HUP $pid; then
             ocf_log info "asked xinetd to reload by sending SIGHUP to process 
$pid!"



Regards,
Vadym

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to