pcp
[Top] [All Lists]

patch pcp stop to exit early when no pmcd running

To: pcp@xxxxxxxxxxx
Subject: patch pcp stop to exit early when no pmcd running
From: Michael Newton <kimbrr@xxxxxxx>
Date: Thu, 12 Jul 2007 10:53:47 +1000
Sender: pcp-bounce@xxxxxxxxxxx
Here is a patch to have /etc/init.d/pcp stop return early when there is no
pmcd running

Nathan has already reviewed, but will consider comments for future
incorporation

--- a/mgmt/pcp/src/pmcd/rc_pcp  2007-07-12 10:49:42.000000000 +1000
+++ b/mgmt/pcp/src/pmcd/rc_pcp  2007-07-12 10:47:28.050587091 +1000
@@ -372,6 +372,16 @@

 _shutdown()
 {
+    # Is pmcd running?
+    #
+    _get_pids_by_name pmcd >$tmp.tmp
+    if [ ! -s $tmp.tmp ]
+    then
+       echo "$prog: PMCD not running"
+       rm -f $PCP_RUN_DIR/pmcd.pid
+       return 0
+    fi
+
     # Send pmcd a SIGTERM, which is noted as a pending shutdown.
     # When finished the currently active request, pmcd will close any
     # connections, wait for any agents, and then exit.

Dr.Michael("Kimba")Newton  kimbrr@xxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
  • patch pcp stop to exit early when no pmcd running, Michael Newton <=