Skip to content

Commit

Permalink
Set the ulimit in the init script with a way to override the limit
Browse files Browse the repository at this point in the history
Fix #916
  • Loading branch information
jvshahid committed Oct 7, 2014
1 parent c059ec5 commit f2a85f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
right content type in the response when compression is enabled
- [Issue #722](https://github.com/influxdb/influxdb/issues/722). Add
an install target to the Makefile
- [Issue #916](https://github.com/influxdb/influxdb/issues/916). Set
ulimit in the init script with a way to override it in /etc/default/influxdb

## v0.8.3 [2014-09-24]

Expand Down
21 changes: 20 additions & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,29 @@
# In the third case we have to define our own functions which are very dumb
# and expect the args to be positioned correctly.

if [ -e /lib/lsb/init-functions ]; then
if [ -r /lib/lsb/init-functions ]; then
source /lib/lsb/init-functions
fi

DEFAULT=/etc/default/influxdb

if [ -r $DEFAULT ]; then
source $DEFAULT
fi

if [ "x$NOFILES" == "x" ]; then
NOFILES=0
fi

if [ $NOFILES -le 0 ]; then
NOFILES=4096
fi

echo "Setting ulimit -n $NOFILES"
if ! ulimit -n $NOFILES >/dev/null 2>&1; then
echo -n "Cannot set the max number of open file descriptors"
fi

function pidofproc() {
if [ $# -ne 3 ]; then
echo "Expected three arguments, e.g. $0 -p pidfile daemon-name"
Expand Down

0 comments on commit f2a85f2

Please sign in to comment.