From 2ff81e5058ddbf75959169ab7be3c19eea6ff190 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 6 Dec 2010 21:40:54 +0100 Subject: Fix portability of ps invocation --- priv/templates/simplenode.runner | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 72d951c..023f7a4 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -66,7 +66,23 @@ case "$1" in stop) # Wait for the node to completely stop... - PID=`ps -ef|grep "$RUNNER_BASE_DIR/.*/[b]eam.smp|awk '{print $2}'"` + case `uname -s` in + Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD) + # PID COMMAND + PID=`ps ax -o pid -o command|\ + grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` + ;; + SunOS) + # PID COMMAND + PID=`ps -ef -o pid -o args|\ + grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` + ;; + CYGWIN*) + # UID PID PPID TTY STIME COMMAND + PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|\ + awk '{print $2}'` + ;; + esac $NODETOOL stop while `kill -0 $PID 2>/dev/null`; do -- cgit v1.1 From 6a7e26e12a46997fc3fb8c2a6fc9f009aafeeab4 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Thu, 9 Dec 2010 17:35:54 +0100 Subject: Disable printing of column headers in ps calls --- priv/templates/simplenode.runner | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'priv') diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 023f7a4..36db59e 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -69,12 +69,12 @@ case "$1" in case `uname -s` in Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD) # PID COMMAND - PID=`ps ax -o pid -o command|\ + PID=`ps ax -o pid= -o command=|\ grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` ;; SunOS) # PID COMMAND - PID=`ps -ef -o pid -o args|\ + PID=`ps -ef -o pid= -o args=|\ grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` ;; CYGWIN*) -- cgit v1.1 From 5bb78f619e7e186e762a3ab95dbfe6caa9f5ba15 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 10 Dec 2010 17:11:01 +0100 Subject: Change vm process search to include non-smp beam --- priv/templates/simplenode.runner | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'priv') diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 36db59e..184ee44 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -70,16 +70,16 @@ case "$1" in Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD) # PID COMMAND PID=`ps ax -o pid= -o command=|\ - grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` + grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'` ;; SunOS) # PID COMMAND PID=`ps -ef -o pid= -o args=|\ - grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|awk '{print $1}'` + grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'` ;; CYGWIN*) # UID PID PPID TTY STIME COMMAND - PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam.smp"|\ + PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|\ awk '{print $2}'` ;; esac -- cgit v1.1 From a6063692b239ca15244d2af61d05d0f773df22e9 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 10 Dec 2010 17:12:50 +0100 Subject: Use cut instead of awk to extract 1st column --- priv/templates/simplenode.runner | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'priv') diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 184ee44..0fb9176 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -70,17 +70,16 @@ case "$1" in Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD) # PID COMMAND PID=`ps ax -o pid= -o command=|\ - grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'` + grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1` ;; SunOS) # PID COMMAND PID=`ps -ef -o pid= -o args=|\ - grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'` + grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1` ;; CYGWIN*) # UID PID PPID TTY STIME COMMAND - PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|\ - awk '{print $2}'` + PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1` ;; esac $NODETOOL stop -- cgit v1.1 From 90c5da80334eed4b97f475e1c0553567a9f14f0a Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 10 Dec 2010 17:17:46 +0100 Subject: Extract column 2 on CYGWIN --- priv/templates/simplenode.runner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 0fb9176..cfde552 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -79,7 +79,7 @@ case "$1" in ;; CYGWIN*) # UID PID PPID TTY STIME COMMAND - PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1` + PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f2` ;; esac $NODETOOL stop -- cgit v1.1