Skip to content

Commit

Permalink
Merge pull request #973 from martincox/develop-3.0
Browse files Browse the repository at this point in the history
Add ulimit check on startup.
  • Loading branch information
ThomasArts authored May 10, 2019
2 parents 0b59c63 + af6aecd commit 1e6f181
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
{template, "rel/files/riak-debug", "bin/riak-debug"},
{template, "rel/files/riak-chkconfig", "bin/riak-chkconfig"},
{template, "rel/files/riak-repl", "bin/riak-repl"},
{template, "rel/files/check_riak_config", "bin/check_riak_config"}
{template, "rel/files/check_riak_config", "bin/check_riak_config"},

{copy, "rel/files/check_ulimit", "bin/hooks/prestart/check_ulimit"}
]},

{generate_start_script, true},
Expand All @@ -97,6 +99,9 @@
]},

{extended_start_script_hooks, [
{pre_start, [
{custom, "hooks/prestart/check_ulimit"}
]},
{post_start, [
{wait_for_process, riak_core_node_watcher}
]}
Expand Down
10 changes: 10 additions & 0 deletions rel/files/check_ulimit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

ULIMIT_WARN=65536
ULIMIT_F=`ulimit -n`

if [ "$ULIMIT_F" -lt $ULIMIT_WARN ]; then
echo "!!!!"
echo "!!!! WARNING: ulimit -n is ${ULIMIT_F}; ${ULIMIT_WARN} is the recommended minimum."
echo "!!!!"
fi

0 comments on commit 1e6f181

Please sign in to comment.