Change simplenode template files to work on more platforms #55

Merged
merged 1 commit into from Mar 2, 2013

2 participants

@jaredmorrow

When developing Riak, we have found bugs and other issues due
to the number of platforms we support.

Here is an overview of the changes:

  • Fix command-line syntax for commands to work on *BSD / Sun
  • Add chkconfig and getpid to nodetool
  • Replace platform specific 'kill' commands with a nodetool getpid method
  • Fix RUNNER_USER settings to work on *BSD
@tuncer tuncer commented on an outdated diff Jan 16, 2013
priv/templates/simplenode.reltool.config
@@ -1,3 +1,5 @@
+%% -*- mode: erlang -*-
+%ex: ft=erlang
@tuncer
tuncer added a note Jan 16, 2013

That should be %% ex: ft=erlang for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tuncer tuncer and 1 other commented on an outdated diff Jan 16, 2013
priv/templates/simplenode.runner
$NODETOOL stop
ES=$?
if [ "$ES" -ne 0 ]; then
exit $ES
fi
- while `kill -0 $PID 2>/dev/null`;
+
+ # Wait for the node to completely stop...
+ while `kill -s 0 $PID 2>/dev/null`;
@tuncer
tuncer added a note Jan 16, 2013

do we need the trailing ;?

It was there from the beginning, I think we do need it, but haven't tested it without.

@tuncer
tuncer added a note Jan 17, 2013

do is on the next line, so it should work without ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tuncer tuncer commented on the diff Jan 16, 2013
priv/templates/simplenode.runner
esac
+
+ # Get the PID from nodetool
+ get_pid
@tuncer
tuncer added a note Jan 16, 2013

where's get_pid defined?

I goofed and left it out of the commit, it is now added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tuncer tuncer commented on the diff Jan 16, 2013
priv/templates/simplenode.runner
REMSH_NAME_ARG="$REMSH_TYPE remsh`date +%s`@`echo $REMSH_NAME | awk -F@ '{print $2}'`"
REMSH_REMSH_ARG="-remsh $REMSH_NAME"
# Extract the target cookie
-COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
+COOKIE_ARG=`grep '^\-setcookie' $VMARGS_PATH`
@tuncer
tuncer added a note Jan 16, 2013

Why change that? Also, let's make sure this doesn't require egrep for portability.

It allows for people to comment out -setcookie lines (same change with -(s)name. It works on grep.

@tuncer
tuncer added a note Jan 17, 2013

Yes, that's why we added ^ some time ago. I'm just surprised about the escaped hyphen.

I'm not sure, you wrote it basho/riak@20303b3 :)

@tuncer
tuncer added a note Jan 17, 2013

Fair point, but I only added ^. The \ has been in riak since @dizzyd's initial basho/riak@36ae7ae but was not present in rebar's current template. @dizzyd?

@tuncer
tuncer added a note Mar 3, 2013

Here's a patch to un-escape it: #72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jaredmorrow jaredmorrow Change simplenode template files to work on more platforms
When developing Riak, we have found bugs and other issues due
to the number of platforms we support.

Here is an overview of the changes:
  -  Fix command-line syntax for commands to work on *BSD / Sun
  -  Add chkconfig and getpid to nodetool
  -  Replace platform specific 'kill' commands with a nodetool
	getpid method
  -  Fix RUNNER_USER settings to work on *BSD
c4989f0
@dizzyd dizzyd commented on the diff Mar 2, 2013
priv/templates/simplenode.runner
*)
- echo "Usage: $SCRIPT {start|start_boot <file>|foreground|stop|restart|reboot|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade}"
+ echo "Usage: $SCRIPT {start|start_boot <file>|foreground|stop|restart|reboot|ping|console|getpid||console_clean|console_boot <file>|attach|remote_console|upgrade}"
@dizzyd
Rebar member
dizzyd added a note Mar 2, 2013

Is there supposed to be a double bar after getpid - @jaredmorrow?

No, looks like a typo to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dizzyd dizzyd merged commit f29e33c into rebar:master Mar 2, 2013

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment