ctdb-tools: Simplify "ctdb getpid" output format
authorMartin Schwenke <martin@meltin.net>
Fri, 22 Jul 2016 05:13:27 +0000 (15:13 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Jul 2016 19:29:45 +0000 (21:29 +0200)
No preamble, just the PID.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/simple/06_ctdb_getpid.sh
ctdb/tools/ctdb.c

index 30137343140571d89095e613503ec44e806a960f..21a6e552e55c204e04bd4573df5c605a0b901cde 100755 (executable)
@@ -59,8 +59,7 @@ echo "Checking each PID for validity"
 
 n=0
 while [ $n -lt $num_nodes ] ; do
-    read line
-    pid=${line#Pid:}
+    read pid
     try_command_on_node $n "ls -l /proc/${pid}/exe | sed -e 's@.*/@@'"
     echo -n "Node ${n}, PID ${pid} looks to be running \"$out\" - "
     if [ "$out" = "ctdbd" ] ; then
index dd009762b5f26fb64db148fa928d9378e89adf8b..e65cbf8c783cd2cbf80966614eb7f42d8b3ee13d 100644 (file)
@@ -2630,7 +2630,7 @@ static int control_getpid(struct ctdb_context *ctdb, int argc, const char **argv
                DEBUG(DEBUG_ERR, ("Unable to get daemon pid from node %u\n", options.pnn));
                return ret;
        }
-       printf("Pid:%d\n", pid);
+       printf("%u\n", pid);
 
        return 0;
 }