Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riak start emitts error when starting on SmartOS #177

Open
dekobon opened this issue Jan 29, 2015 · 0 comments
Open

Riak start emitts error when starting on SmartOS #177

dekobon opened this issue Jan 29, 2015 · 0 comments

Comments

@dekobon
Copy link

dekobon commented Jan 29, 2015

This issue is similar to this issue: #117

When starting the riak script as so:

[root@riak-02-staging ~]# riak start
***
Warning: please use 'svcadm enable riak' instead
***
/opt/local/sbin/riak[185]: [: argument expected
[root@riak-02-staging ~]# riak ping
pong

If I am manually starting everything works well. However, if I am starting with SMF, this will cause havoc and it will result in the process not starting properly some of the time.

I've looked at the code that is offending - bin/riak:185 :

    # Make sure we have access to enough file descriptors
    ULIMIT_S=$(prctl -n process.max-file-descriptor -t basic -P $$ | awk '/max-file-descriptor/ { print $3 }')
    ULIMIT_H=$(prctl -n process.max-file-descriptor -t priv -P $$ | awk '/max-file-descriptor/ { print $3 }')
    if [ ${ULIMIT_S} -lt ${ULIMIT_H} ]; then
        echo "Trying to raise the file descriptor limit to maximum allowed."
        prctl -n process.max-file-descriptor -t basic -v ${ULIMIT_H} $$ || true
    fi

What's happening is the command executing for ULIMIT_S is returning a blank string. I believe this can be easily rectified by adding quotes in the conditional as so:

    # Make sure we have access to enough file descriptors
    ULIMIT_S=$(prctl -n process.max-file-descriptor -t basic -P $$ | awk '/max-file-descriptor/ { print $3 }')
    ULIMIT_H=$(prctl -n process.max-file-descriptor -t priv -P $$ | awk '/max-file-descriptor/ { print $3 }')
    if [ "${ULIMIT_S}" -lt "${ULIMIT_H}" ]; then
        echo "Trying to raise the file descriptor limit to maximum allowed."
        prctl -n process.max-file-descriptor -t basic -v ${ULIMIT_H} $$ || true
    fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant