Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove bashisms from shell scripts which use /bin/sh #141

Merged
merged 1 commit into from

2 participants

@jaredmorrow

Fixes #140

type -p is not supported by /bin/sh and caused the riak and riak-admin scripts
to think that sudo was not available. In addition kill -SIGNAL is not portable
to /bin/sh and should be replaced by kill -s SIGNAL instead.

The portability was checked with checkbashisms from the devscripts package in
ubuntu 10.04 and was tested on /bin/sh in solaris, ubuntu, and OSX.

@jaredmorrow jaredmorrow Remove bashisms from shell scripts which use /bin/sh
Fixes #140

`type -p` is not supported by /bin/sh and caused the riak and riak-admin scripts
to think that `sudo` was not available.  In addition `kill -SIGNAL` is not portable
to /bin/sh and should be replaced by `kill -s SIGNAL` instead.

The portability was checked with `checkbashisms` from the devscripts package in
ubuntu 10.04 and was tested on /bin/sh in solaris, ubuntu, and OSX.
24176a7
@beerriot

+1 works for me, thanks

@jaredmorrow jaredmorrow merged commit 0968f0a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2012
  1. @jaredmorrow

    Remove bashisms from shell scripts which use /bin/sh

    jaredmorrow authored
    Fixes #140
    
    `type -p` is not supported by /bin/sh and caused the riak and riak-admin scripts
    to think that `sudo` was not available.  In addition `kill -SIGNAL` is not portable
    to /bin/sh and should be replaced by `kill -s SIGNAL` instead.
    
    The portability was checked with `checkbashisms` from the devscripts package in
    ubuntu 10.04 and was tested on /bin/sh in solaris, ubuntu, and OSX.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +2 −2 rel/files/riak
  2. +1 −1  rel/files/riak-admin
  3. +1 −1  rel/files/search-cmd
View
4 rel/files/riak
@@ -26,7 +26,7 @@ RIAK_VERSION="git"
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
@@ -171,7 +171,7 @@ case "$1" in
if [ "$ES" -ne 0 ]; then
exit $ES
fi
- while `kill -0 $PID 2>/dev/null`;
+ while `kill -s 0 $PID 2>/dev/null`;
do
sleep 1
done
View
2  rel/files/riak-admin
@@ -19,7 +19,7 @@ RUNNER_USER={{runner_user}}
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
View
2  rel/files/search-cmd
@@ -19,7 +19,7 @@ RUNNER_USER={{runner_user}}
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
Something went wrong with that request. Please try again.