Skip to content

Commit 1e6f181

Browse files
authored
Merge pull request #973 from martincox/develop-3.0
Add ulimit check on startup.
2 parents 0b59c63 + af6aecd commit 1e6f181

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

rebar.config

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@
8484
{template, "rel/files/riak-debug", "bin/riak-debug"},
8585
{template, "rel/files/riak-chkconfig", "bin/riak-chkconfig"},
8686
{template, "rel/files/riak-repl", "bin/riak-repl"},
87-
{template, "rel/files/check_riak_config", "bin/check_riak_config"}
87+
{template, "rel/files/check_riak_config", "bin/check_riak_config"},
88+
89+
{copy, "rel/files/check_ulimit", "bin/hooks/prestart/check_ulimit"}
8890
]},
8991

9092
{generate_start_script, true},
@@ -97,6 +99,9 @@
9799
]},
98100

99101
{extended_start_script_hooks, [
102+
{pre_start, [
103+
{custom, "hooks/prestart/check_ulimit"}
104+
]},
100105
{post_start, [
101106
{wait_for_process, riak_core_node_watcher}
102107
]}

rel/files/check_ulimit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
ULIMIT_WARN=65536
4+
ULIMIT_F=`ulimit -n`
5+
6+
if [ "$ULIMIT_F" -lt $ULIMIT_WARN ]; then
7+
echo "!!!!"
8+
echo "!!!! WARNING: ulimit -n is ${ULIMIT_F}; ${ULIMIT_WARN} is the recommended minimum."
9+
echo "!!!!"
10+
fi

0 commit comments

Comments
 (0)