summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2010-12-06 21:40:54 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2010-12-07 11:55:34 +0100
commit2ff81e5058ddbf75959169ab7be3c19eea6ff190 (patch)
tree6dbbfda20aca3fa25b96b2f42cd80ac40b7c3f16 /priv
parent0bb429c19751ebdb55f1e15dba5444f6fac6e8ad (diff)
Fix portability of ps invocation
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/simplenode.runner18
1 files changed, 17 insertions, 1 deletions
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